wilzbach/msa

View on GitHub

Showing 67 of 149 total issues

Function render has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

  render: function() {
    this._createCanvas();
    this.el.textContent = "overview";
    this.el.style.marginTop = this.g.zoomer.get("overviewboxPaddingTop");

Severity: Minor
Found in src/views/OverviewBox.js - About 6 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 genConservedSequences has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

  genConservedSequences: (len, seqLen, dict) => {
    const seqs = [];
    if (!(typeof len !== "undefined" && len !== null)) { len = BMath.getRandomInt(3,5); }
    if (!(typeof seqLen !== "undefined" && seqLen !== null)) { seqLen = BMath.getRandomInt(50,200); }

Severity: Minor
Found in src/utils/seqgen.js - About 5 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 render has 80 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render: function() {
    this.setName("Filter");
    this.addNode("Hide columns by threshold",(e) => {
      let threshold = prompt("Enter threshold (in percent)", 20);
      threshold = threshold / 100;
Severity: Major
Found in src/menu/views/FilterMenu.js - About 3 hrs to fix

    File CanvasSeqBlock.js has 282 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    const boneView = require("backbone-childs");
    const mouse = require("mouse-pos");
    import {throttle} from "lodash";
    const jbone = require("jbone");
    
    
    Severity: Minor
    Found in src/views/canvas/CanvasSeqBlock.js - About 2 hrs to fix

      Function initialize has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

        initialize: function(data) {
      
          if (!(typeof data !== "undefined" && data !== null)) { data = {}; }
          // check for default arrays
          if (!(data.colorscheme != null)) { data.colorscheme = {}; }
      Severity: Minor
      Found in src/msa.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 getComparators has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        getComparators: function() {
          var models = [];
      
          models.push({text: "ID " + arrowUp, comparator: "id"});
      
      
      Severity: Major
      Found in src/menu/views/OrderingMenu.js - About 2 hrs to fix

        Function showTree has 54 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            showTree: function(newickStr) {
              var newick = window.require("biojs-io-newick");
              var mt = window.require("msa-tnt");
        
              if (typeof newickStr === "string") {
        Severity: Major
        Found in src/utils/tree.js - About 2 hrs to fix

          Function getComparators has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
          Open

            getComparators: function() {
              var models = [];
          
              models.push({text: "ID " + arrowUp, comparator: "id"});
          
          
          Severity: Minor
          Found in src/menu/views/OrderingMenu.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 render has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
          Open

            render: function() {
              dom.removeAllChilds(this.el);
          
              this.el.style.display = "inline-block";
          
          
          Severity: Minor
          Found in src/views/labels/MetaView.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 initialize has 51 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            initialize: function(data) {
          
              if (!(typeof data !== "undefined" && data !== null)) { data = {}; }
              // check for default arrays
              if (!(data.colorscheme != null)) { data.colorscheme = {}; }
          Severity: Major
          Found in src/msa.js - About 2 hrs to fix

            Function _renderSelection has 50 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              _renderSelection: function(data) {
            
                let xZero = data.xZero;
                const yZero = data.yZero;
                const n = data.n;
            Severity: Minor
            Found in src/views/canvas/CanvasSelection.js - About 2 hrs to fix

              Function render has 50 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                render: function() {
                  var conserv = this.g.stats.scale(this.g.stats.conservation());
              
                  dom.removeAllChilds(this.el);
              
              
              Severity: Minor
              Found in src/views/header/ConservationView.js - About 2 hrs to fix

                Function render has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  render: function() {
                    this._createCanvas();
                    this.el.textContent = "overview";
                    this.el.style.marginTop = this.g.zoomer.get("overviewboxPaddingTop");
                
                
                Severity: Minor
                Found in src/views/OverviewBox.js - About 1 hr to fix

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

                      showTree: function(newickStr) {
                        var newick = window.require("biojs-io-newick");
                        var mt = window.require("msa-tnt");
                  
                        if (typeof newickStr === "string") {
                  Severity: Minor
                  Found in src/utils/tree.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 render has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    render: function() {
                      dom.removeAllChilds(this.el);
                  
                      this.el.style.display = "inline-block";
                  
                  
                  Severity: Minor
                  Found in src/views/labels/MetaView.js - About 1 hr to fix

                    Function render has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      render: function() {
                        dom.removeAllChilds(this.el);
                    
                        this.el.style.width = `${this.g.zoomer.getLabelWidth()}px`;
                        //@el.style.height = "#{@g.zoomer.get "rowHeight"}px"
                    Severity: Minor
                    Found in src/views/labels/LabelView.js - About 1 hr to fix

                      Function initialize has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        initialize: function(data) {
                          this.g = data.g;
                      
                          this.listenTo(this.g.zoomer, "change:_alignmentScrollLeft change:_alignmentScrollTop", function(model,value, options) {
                            if ((!(((typeof options !== "undefined" && options !== null) ? options.origin : undefined) != null)) || options.origin !== "canvasseq") {
                      Severity: Minor
                      Found in src/views/canvas/CanvasSeqBlock.js - About 1 hr to fix

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

                          _buildM: function(data) {
                            let displayedButton, frag, key, li, node, style, _ref;
                            let nodes = data.nodes;
                            let name = data.name;
                            let menu = document.createElement("div");
                        Severity: Minor
                        Found in src/menu/menulib.js - About 1 hr to fix

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

                            render: function() {
                              var conserv = this.g.stats.scale(this.g.stats.conservation());
                          
                              dom.removeAllChilds(this.el);
                          
                          
                          Severity: Minor
                          Found in src/views/header/ConservationView.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 colorer has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                          Open

                            colorer: function(colorRange) {
                              let colorer = function() { return "none" };
                          
                              if( typeof colorRange === 'string' ) {
                                colorer = function() { return colorRange };
                          Severity: Minor
                          Found in src/views/header/ConservationView.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

                          Severity
                          Category
                          Status
                          Source
                          Language