reimandlab/Visualistion-Framework-for-Genome-Mutations

View on GitHub

Showing 316 of 340 total issues

Function mutations_affecting_ptm_sites has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

def mutations_affecting_ptm_sites(f, sources):

    header = [
        'gene',
        'refseq',
Severity: Minor
Found in website/exports/protein_data.py - About 1 hr 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 tsv_file_iterator has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

def tsv_file_iterator(
    filename, file_header=None, file_opener=open, mode='r',
    skip=None, limit=None, sep='\t'
):
    data_lines_count = count_lines_tsv(filename, file_opener=file_opener, mode=mode)
Severity: Minor
Found in website/helpers/parsers.py - About 1 hr 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 cache_decorator has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

def cache_decorator(cache: Cache) -> Callable:
    """Create a decorator caching results of the function calls.

    The cache is specific to the function name and provided arguments.

Severity: Minor
Found in website/helpers/cache.py - About 1 hr 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 htmlwidget has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

def htmlwidget(interactive_plot, args):
    knitr_output = htmlwidgets.knit_print_htmlwidget(interactive_plot, standalone=False)
    html = list(knitr_output)[0].replace('<!--html_preserve-->', '').replace('<!--/html_preserve-->', '')
    deps = base.attr(knitr_output, 'knit_meta')
    javascript = ''
Severity: Minor
Found in website/ggplot.py - About 1 hr 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 Progress has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function Progress()
{
    var url;
    var progress_span, progress_bar;
    var state_failure, state_progress, state_pending;
Severity: Minor
Found in website/static/progress.js - About 1 hr to fix

    Function multilinePlaceholderPolyfill has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var multilinePlaceholderPolyfill = (function()
    {
        // allows to use multiline placeholders if textarea is given as field,
        // or imitates normal placeholders if an input is given as field
        var field
    Severity: Minor
    Found in website/static/search.js - About 1 hr to fix

      Function init has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              init: function(data)
              {
                  update_object(config, data)
                  var box = $(data.box)
                  input = box.find('input')
      Severity: Minor
      Found in website/static/searchbar.js - About 1 hr to fix

        Function create_nodes has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function create_nodes(data)
            {
                groups = data.kinase_groups;
        
                central_node = createProteinNode(data.protein);
        Severity: Minor
        Found in website/static/network.js - About 1 hr to fix

          Function SearchBar has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

          var SearchBar = function ()
          {
              var input
              var results_div
              var current_query
          Severity: Minor
          Found in website/static/searchbar.js - About 1 hr 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 saveMessage has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function saveMessage(editable_box)
              {
                  $.ajax({
                      url: config.endpoint_save,
                      type: 'POST',
          Severity: Minor
          Found in website/static/inline_edit.js - About 1 hr to fix

            Function checkbox_list has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function checkbox_list(uls)
                {
                    function block(ul)
                    {
                        ul.popover('show');
            Severity: Minor
            Found in website/static/widgets.js - About 1 hr to fix

              Function prepareSites has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function prepareSites(sites, standalone_kinases)
                  {
                      var cloned_kinases = []
              
                      function parse(site)
              Severity: Minor
              Found in website/static/network.js - About 1 hr to fix

                Function _setZoomAndMove has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function _setZoomAndMove(new_zoom, new_pos, stop_callback, skip_animation, center_view)
                    {
                        new_pos = trim_position(new_pos, new_zoom)
                
                        var styles = scalableElem.style;
                Severity: Minor
                Found in website/static/tracks.js - About 1 hr to fix

                  Function initTable has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function initTable($table, query, additional_columns)
                  {
                      var initial_query = query
                  
                      function detailFormatter(index, row, $element)
                  Severity: Minor
                  Found in website/static/pathways.js - About 1 hr 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 resolve_import_order has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def resolve_import_order(self):
                          # make a copy of importers list
                          unordered = self.importers[:]
                  
                          ordered = []
                  Severity: Minor
                  Found in website/imports/manager.py - About 1 hr 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 ProteinForm has a Cognitive Complexity of 13 (exceeds 5 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: Minor
                  Found in website/static/search.js - About 1 hr 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 divide_muts_by_sites has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def divide_muts_by_sites(mutations, sites):
                      """Aggregates mutations that are within +/-7 positions from sites by site"""
                      from collections import defaultdict
                      muts_by_site = defaultdict(list)
                  
                  
                  Severity: Minor
                  Found in website/views/network.py - About 1 hr 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 best_uniprot_entry has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def best_uniprot_entry(self) -> UniprotEntry:
                          if self.external_references:
                              entries = self.external_references.uniprot_entries
                              if not entries:
                                  return None
                  Severity: Minor
                  Found in website/models/bio/protein.py - About 1 hr 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 joined_query has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def joined_query(query, required_joins, limit_to=None):
                      already_joined = set()
                      for joins in required_joins:
                          for join in joins:
                              if limit_to and join not in limit_to:
                  Severity: Minor
                  Found in website/helpers/filters/manager.py - About 1 hr 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 select_filters has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def select_filters(filters, models):
                      """Selects filters which are applicable to at least one of given models."""
                      selected = set()
                      tables = [model.__table__ for model in models]
                  
                  
                  Severity: Minor
                  Found in website/views/gene.py - About 1 hr 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

                  Severity
                  Category
                  Status
                  Source
                  Language