-
Notifications
You must be signed in to change notification settings - Fork 1
v0.2.0 (Sourcery refactored) #218
base: dev
Are you sure you want to change the base?
Conversation
Sourcery Code Quality Report❌ Merging this PR will decrease code quality in the affected files by 0.26%.
Here are some functions in these files that still need a tune-up:
Legend and ExplanationThe emojis denote the absolute quality of the code:
The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request. Please see our documentation here for details on how these metrics are calculated. We are actively working on this report - lots more documentation and extra metrics to come! Help us improve this quality report! |
2d91a54
to
24a6ee1
Compare
15e876c
to
88f0f7b
Compare
8d7e516
to
7c78018
Compare
f2f36da
to
3c6d80e
Compare
97b2068
to
1b07830
Compare
1b07830
to
002b5b7
Compare
09c3563
to
72df7ac
Compare
c900386
to
3d13819
Compare
95d4239
to
41e7f05
Compare
41e7f05
to
c7a3d49
Compare
8388f35
to
49249bf
Compare
da3dc6f
to
3cddecf
Compare
3cddecf
to
dd73a96
Compare
flag_data.update([flag]) | ||
flag_data |= [flag] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function FastaFlagExtractor.extract_all
refactored with the following changes:
- Merge dictionary updates via the union operator (
dict-assign-update-to-union
)
flag_data.update([flag]) | ||
flag_data |= [flag] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function FastqFlagExtractor.__add_qual_flags
refactored with the following changes:
- Merge dictionary updates via the union operator (
dict-assign-update-to-union
)
if FastxFormats.FASTQ == fmt: | ||
return FastqFlagExtractor | ||
return ABCFlagExtractor | ||
return FastqFlagExtractor if FastxFormats.FASTQ == fmt else ABCFlagExtractor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function get_fastx_flag_extractor
refactored with the following changes:
- Lift code into else after jump in control flow (
reintroduce-else
) - Replace if statement with if expression (
assign-if-exp
)
flag_data.update([(name, (value, -1, -1))]) | ||
flag_data |= [(name, (value, -1, -1))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function FastxFlagReader.read
refactored with the following changes:
- Merge dictionary updates via the union operator (
dict-assign-update-to-union
)
if FastxFormats.FASTQ == fmt: | ||
return SimpleFastqWriter | ||
return SimpleFastxWriter | ||
return SimpleFastqWriter if FastxFormats.FASTQ == fmt else SimpleFastxWriter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function get_fastx_writer
refactored with the following changes:
- Lift code into else after jump in control flow (
reintroduce-else
) - Replace if statement with if expression (
assign-if-exp
)
while bases_qscores: | ||
if bases_qscores[0] >= qscore_thr: | ||
break | ||
while bases_qscores and bases_qscores[0] < qscore_thr: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function FastqTrimmer.__trim_qual_5
refactored with the following changes:
- Move a guard clause in a while statement's body into its test (
while-guard-to-condition
) - Simplify logical expression using De Morgan identities (
de-morgan
)
while bases_qscores: | ||
if bases_qscores[-1] >= qscore_thr: | ||
break | ||
while bases_qscores and bases_qscores[-1] < qscore_thr: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function FastqTrimmer.__trim_qual_3
refactored with the following changes:
- Move a guard clause in a while statement's body into its test (
while-guard-to-condition
) - Simplify logical expression using De Morgan identities (
de-morgan
)
if FastxFormats.FASTQ == fmt: | ||
return FastqTrimmer | ||
return ABCTrimmer | ||
return FastqTrimmer if FastxFormats.FASTQ == fmt else ABCTrimmer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function get_fastx_trimmer
refactored with the following changes:
- Lift code into else after jump in control flow (
reintroduce-else
) - Replace if statement with if expression (
assign-if-exp
)
Pull Request #142 refactored by Sourcery.
If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.
NOTE: As code is pushed to the original Pull Request, Sourcery will
re-run and update (force-push) this Pull Request with new refactorings as
necessary. If Sourcery finds no refactorings at any point, this Pull Request
will be closed automatically.
See our documentation here.
Run Sourcery locally
Reduce the feedback loop during development by using the Sourcery editor plugin:
Review changes via command line
To manually merge these changes, make sure you're on the
dev
branch, then run:Help us improve this pull request!