reimandlab/Visualistion-Framework-for-Genome-Mutations

View on GitHub

Showing 316 of 340 total issues

Function InlineEditManager has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

var InlineEditManager = function()
{
    // values in the default config are dummy - just to illustrate the concept
    var config = {
        endpoint_save: '/save_message/',
Severity: Minor
Found in website/static/inline_edit.js - About 3 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 gather_muts_and_sites has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    def gather_muts_and_sites(
        self, mutations: BaseQuery, sites: BaseQuery,
        show_progress=True, occurrences_in: List[MutationSource] = None, intersection=None
    ) -> MotifsData:
        """If occurrences_in is provided, the count of mutations will
Severity: Minor
Found in website/analyses/motifs.py - About 3 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 manager.py has 322 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import re
from collections import namedtuple, defaultdict

from sqlalchemy import and_

Severity: Minor
Found in website/helpers/filters/manager.py - About 3 hrs to fix

    Function init_nodes has 93 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function init_nodes(vis, nodes_data, created_nodes)
        {
            tooltip = init_tooltips()
    
            nodes = vis.selectAll('.node')
    Severity: Major
    Found in website/static/network.js - About 3 hrs to fix

      File __init__.py has 320 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import gc
      import gzip
      from abc import abstractmethod
      from collections import defaultdict
      from typing import List, Iterable
      Severity: Minor
      Found in website/imports/mutations/mutation_importer/__init__.py - About 3 hrs to fix

        Function ProteinForm has 90 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var ProteinForm = (function ()
        {
            var element
            var empty_indicator, no_results_indicator, waiting_indicator
            var result_ul, recent_value, protein_search
        Severity: Major
        Found in website/static/search.js - About 3 hrs to fix

          File basic_filter.py has 316 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import operator
          from functools import lru_cache
          from types import MethodType
          
          from sqlalchemy.ext.associationproxy import AssociationProxyInstance
          Severity: Minor
          Found in website/helpers/filters/basic_filter.py - About 3 hrs to fix

            Function count_ptm has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
            Open

            def count_ptm(
                counter, site_types: Iterable[models.SiteType] = tuple(), models=None,
                only_primary=False, site_mode='any',
                custom_filters=None,
                custom_joins=None
            Severity: Minor
            Found in website/stats/table.py - About 3 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 MutationTable has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
            Open

            var MutationTable = function ()
            {
                var element
                var mutations
                var impact_importances = {}
            Severity: Minor
            Found in website/static/table.js - About 3 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 import_genome_proteome_mappings has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
            Open

            def import_genome_proteome_mappings(
                proteins: Dict[str, Protein],
                mappings_dir='data/200616/all_variants/playground',
                mappings_file_pattern='annot_*.txt.gz',
                bdb_dir=''
            Severity: Minor
            Found in website/imports/mappings.py - About 3 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 as_sqlalchemy has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
            Open

                def as_sqlalchemy(self, target):
            
                    value = self.mapped_value
            
                    if value is None:
            Severity: Minor
            Found in website/helpers/filters/sqlalchemy_filter.py - About 3 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 assets.py has 305 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            from flask_assets import Bundle
            from abc import ABC, abstractmethod
            from flask import Markup
            
            
            
            Severity: Minor
            Found in website/assets.py - About 3 hrs to fix

              Function ShortURL has 81 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              var ShortURL = function()
              {
                  // values in the default config are dummy - just to illustrate the concept
                  var config = {
                      endpoint_get: '/get_shorthand_for_url_provided_in_get/',
              Severity: Major
              Found in website/static/short_url.js - About 3 hrs to fix

                MutationImporter has 27 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class MutationImporter(BioImporter, MutationExporter):
                
                    @abstract_property
                    def name(self):
                        """Name of the mutations importer"""
                Severity: Minor
                Found in website/imports/mutations/mutation_importer/__init__.py - About 3 hrs to fix

                  Function init_tinymce has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function init_tinymce(config)
                  {
                      var default_config = {
                          selector: 'textarea',
                          body_class: 'page-content',
                  Severity: Major
                  Found in website/static/cms_editor.js - About 3 hrs to fix

                    Function Widgets has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    var Widgets = (function () {
                        var form
                        var select_sth_popover = {
                            content: 'You should select at least one option',
                            placement: 'top',
                    Severity: Major
                    Found in website/static/widgets.js - About 2 hrs to fix

                      Function import_aminoacid_mutation_refseq_mappings has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def import_aminoacid_mutation_refseq_mappings(
                          proteins: Dict[str, Protein],
                          mappings_dir='data/200616/all_variants/playground',
                          mappings_file_pattern='annot_*.txt.gz',
                          bdb_dir=''
                      Severity: Minor
                      Found in website/imports/mappings.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 a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def __init__(self, domains):
                      
                              tracks = OrderedDict()
                      
                              grouped_domains = self.group_domains(domains)
                      Severity: Minor
                      Found in website/helpers/tracks.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 basic_auto_migrate_relational_db has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def basic_auto_migrate_relational_db(app, bind: str):
                          """Inspired by http://stackoverflow.com/questions/2103274/"""
                      
                          from sqlalchemy import Table
                          from sqlalchemy import MetaData
                      Severity: Minor
                      Found in website/database/migrate.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 ForceManager has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function ForceManager(config)
                          {
                              var force_affected_nodes = [];
                              var force_affected_links = [];
                              var force;
                      Severity: Major
                      Found in website/static/network.js - About 2 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language