reimandlab/Visualistion-Framework-for-Genome-Mutations

View on GitHub

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,
Severity: Minor
Found in website/stats/plots/ptm_mutations.py - About 2 hrs to fix

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)
Severity: Major
Found in website/static/tracks.js - About 2 hrs to fix

    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)
        {
    Severity: Major
    Found in website/static/searchbar.js - About 2 hrs to fix

      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 = [];
      
      
      Severity: Major
      Found in website/static/zoom.js - About 2 hrs to fix

        Function Orbits has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

        var Orbits = function ()
        {
            var nodes = null
            var central_node = null
        
        
        Severity: Minor
        Found in website/static/orbits.js - About 2 hrs to fix

        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
        Severity: Minor
        Found in website/stats/table.py - About 2 hrs to fix

        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)
        
        
        Severity: Minor
        Found in website/stats/plots/motifs.py - About 2 hrs to fix

        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,
        Severity: Minor
        Found in website/imports/sites/site_mapper.py - About 2 hrs to fix

        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')
            )
        Severity: Minor
        Found in website/models/bio/mutations.py - About 2 hrs to fix

          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)
          
          
          Severity: Minor
          Found in website/analyses/conservation/scores.py - About 2 hrs to fix

          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
          Severity: Minor
          Found in website/models/bio/mutations.py - About 2 hrs to fix

          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_
          Severity: Minor
          Found in website/search/gene.py - About 2 hrs to fix

            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
            
            
            Severity: Major
            Found in website/static/network.js - About 2 hrs to fix

              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
                      }
              Severity: Major
              Found in website/static/network.js - About 2 hrs to fix

                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.
                    """
                Severity: Minor
                Found in website/analyses/variability_in_population.py - About 2 hrs to fix

                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.
                
                
                Severity: Minor
                Found in website/imports/protein_data.py - About 2 hrs to fix

                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:
                Severity: Minor
                Found in website/app.py - About 2 hrs to fix

                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));
                
                
                Severity: Major
                Found in website/static/network.js - About 2 hrs to fix

                  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)
                          {
                  Severity: Major
                  Found in website/static/network.js - About 2 hrs to fix

                    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')
                    Severity: Minor
                    Found in website/static/network.js - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language