Function ptm_variability_population_rare_substitutions
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def ptm_variability_population_rare_substitutions(site_type, motif=None):
"""Compare variability of sequence in PTM sites
with the variability of sequence outside of PTM sites,
using frequency of rare substitutions.
"""
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function proteins_variability
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def proteins_variability(source, only_primary=True, site_type=None, without_sites=False, by_counts=False, site_motif=None):
Function proteins_variability
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def proteins_variability(source, only_primary=True, site_type=None, without_sites=False, by_counts=False, site_motif=None):
if by_counts:
variability_measure = func.count(distinct(source.id))
else:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function variability_in_population
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def variability_in_population(
Avoid deeply nested control flow statements. Open
if muts_count == 0:
percentage = 0
variability.append(float(percentage))
Function group_by_substitution_rates
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def group_by_substitution_rates(source, only_primary=True, bins_count=100, by_frequency=False, site_type=None):
Function variability_in_population
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def variability_in_population(
source, site_type=None, protein_subset=None, rare_threshold=0.5,
only_primary=True, site_motif=None
):
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function proteins_variability_by_ptm_presence
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def proteins_variability_by_ptm_presence(site_type, by_counts, site_motif=None):
results = {}
for group, without_ptm, site_type in [('Without PTM sites', True, None), ('With PTM sites', False, site_type)]:
result = {}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"