Showing 316 of 340 total issues
Function gather_ptm_muts_impacts
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def gather_ptm_muts_impacts(
source: MutationSource,
site_type: SiteType,
limit_to_genes: List[str] = None,
occurrences=True,
- 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 init
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function(new_config)
{
configure(new_config)
box = $(config.box)
Function advanced_searchbar_templator
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
function advanced_searchbar_templator(mutation_template, protein_template)
{
function template_mutation(result, name)
{
Function CSS_Zoom
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
var CSS_Zoom = function(my_parent)
{
var parent = my_parent
var canvas_size = [];
Function Orbits
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
var Orbits = function ()
{
var nodes = null
var central_node = null
- 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 source_specific_nucleotide_mappings
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def source_specific_nucleotide_mappings() -> TableChunk:
from database import bdb
from genomic_mappings import decode_csv
from models import Mutation
from tqdm import tqdm
- 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 prepare_motifs_plot
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def prepare_motifs_plot(counts_by_gene, site_type: SiteType, y_axis: str):
# order by percentage
genes_ordered = genes_by_ratio(counts_by_gene, y_axis)
- 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 map_sites_by_sequence
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def map_sites_by_sequence(self, sites: DataFrame) -> DataFrame:
"""Given a site with an isoform it should occur in,
verify if the site really appears on the given position
in this isoform and find where in all other isoforms
this site appears (by exact match of a sequence span,
- 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
Mutation
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class Mutation(BioModel, MutatedMotifs):
__table_args__ = (
db.Index('mutation_index', 'alt', 'protein_id', 'position'),
db.UniqueConstraint('alt', 'protein_id', 'position')
)
Function scores_for_proteins
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def scores_for_proteins(proteins: Iterable, genes_data: DataFrame, big_wig_path: str) -> Tuple[Dict, Namespace]:
"""Load conservation scores, average when needed, and transform into protein space."""
bw = pyBigWig.open(big_wig_path)
- 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 affected_motifs
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def affected_motifs(self, sites: Iterable[Site] = None):
if self.were_affected_motifs_precomputed:
return self.precomputed_affected_motifs
from analyses.motifs import mutate_sequence
- 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
File gene.py
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
from abc import ABC, abstractmethod
from collections import defaultdict
from Levenshtein import distance
from sqlalchemy import and_
Function switchGroupState
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
function switchGroupState(group, state, time)
{
time = (time === undefined) ? 600 : time
group.expanded = (state === undefined) ? !group.expanded : state
Function create_shapes
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function create_shapes()
{
function radians(x){
return x * Math.PI / 180
}
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_and_genes
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def proteins_and_genes(path='data/protein_data.tsv'):
"""Create proteins and genes based on data in a given file.
If protein/gene already exists it will be skipped.
- 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 create_app
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def create_app(config_filename='config.py', config_override={}):
"""Factory function for flask application.
Args:
config_filename:
- 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 create_ticker
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function create_ticker()
{
var site_nodes = nodes.filter(is_of_type(types.site));
var drug_nodes = nodes.filter(is_of_type(types.drug));
Function node_dbl_click
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function node_dbl_click(node)
{
if(d3.event.defaultPrevented === false)
{
Function init_edges
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
function init_edges(vis, edges)
{
links = vis.selectAll('.link')
.data(edges)
.enter().append('line')