wilzbach/msa

View on GitHub

Showing 67 of 149 total issues

Function _getSelection has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  _getSelection: function(model) {
    const maxLen = model.get("seq").length;
    const selection = [];
    const sels = this.g.selcol.getSelForRow(model.get("id"));
    const rows = find(sels, function(el) { return el.get("type") === "row"; });
Severity: Minor
Found in src/views/canvas/CanvasSelection.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 saveSelection has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  saveSelection: function(that,name) {
    let selection = that.g.selcol.pluck("seqId");
    console.log(selection);
    if (selection.length > 0) {
      // filter those seqids
Severity: Minor
Found in src/utils/exporter.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 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render: function() {
    this.setName("Extras");
    var stats = this.g.stats;
    var msa = this.msa;
    this.addNode("Add consensus seq", () => {
Severity: Minor
Found in src/menu/views/ExtraMenu.js - About 1 hr to fix

    Function addFeatures has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      addFeatures: function(features) {
        if ((features.config != null)) {
          const obj = features;
          features = features.seqs;
          if ((obj.config.colors != null)) {
    Severity: Minor
    Found in src/model/SeqCollection.js - About 1 hr to fix

      Function guessFileFromText has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        { guessFileFromText: function(text, opt) {
          if (!(typeof text !== "undefined" && text !== null)) {
            console.warn("invalid file format");
            return ["", "error"];
          }
      Severity: Minor
      Found in src/utils/file.js - About 1 hr to fix

        Function colorer has 26 lines of code (exceeds 25 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

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

            render: function() {
              this.setName("Export");
          
              this.addNode("Share view (URL)" + ShareSym, () => {
                return Exporter.shareLink(this.msa, function(link) {
          Severity: Minor
          Found in src/menu/views/ExportMenu.js - About 55 mins 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 9 (exceeds 5 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 55 mins 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 getDummySequences has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

            getDummySequences: function(len, seqLen) {
              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 55 mins 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 invertCol has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            invertCol: function(columns) {
              const selColumns = this.where({type:"column"}).reduce((memo,el) => {
                return memo.concat(((() => {
                  const result = [];
                  let i = el.attributes.xStart;
          Severity: Minor
          Found in src/g/selection/SelectionCol.js - About 45 mins 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 _drawSelection has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            _drawSelection: function() {
              // hide during selection
              if (this.dragStart.length > 0 && !this.prolongSelection) { return; }
          
              this.ctx.fillStyle = "#666666";
          Severity: Minor
          Found in src/views/OverviewBox.js - About 45 mins 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

          Avoid deeply nested control flow statements.
          Open

                      if (hidden.indexOf(j) >= 0) {
                        color = "grey";
                      }
          Severity: Major
          Found in src/views/OverviewBox.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                        if (seq_hidden[i]) {
                          colors.push("grey");
                          continue;
                        }
            Severity: Major
            Found in src/views/OverviewBox.js - About 45 mins to fix

              Function markerHidden has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                markerHidden: function(n,stepSize) {
                  const hidden = this.g.columns.get("hidden").slice(0);
              
                  const min = Math.max(0, n - stepSize);
                  let prevHidden = true;
              Severity: Minor
              Found in src/views/header/MarkerView.js - About 45 mins 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

              Avoid deeply nested control flow statements.
              Open

                          if ((typeof color !== "undefined" && color !== null)) {
                            colors.push(color);
                          }
              Severity: Major
              Found in src/views/OverviewBox.js - About 45 mins to fix

                Function getMinRows has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                  getMinRows: function() {
                
                    const len = (this.max(function(el) { return el.get("xEnd"); })).attributes.xEnd;
                    const rows = ((() => {
                      const result = [];
                Severity: Minor
                Found in src/model/FeatureCol.js - About 45 mins 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 importFiles has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                  importFiles: function(files) {
                    return (() => {
                      var result = [];
                      var end = files.length - 1;
                      for (var i = 0; 0 < end ? i <= end : i >= end; 0 < end ? i++ : i--) {
                Severity: Minor
                Found in src/utils/file.js - About 45 mins 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

                Avoid deeply nested control flow statements.
                Open

                            if (showLowerCase) { c = c.toUpperCase(); }
                Severity: Major
                Found in src/views/OverviewBox.js - About 45 mins to fix

                  Function assignRows has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                    assignRows: function() {
                  
                      const len = (this.max(function(el) { return el.get("xEnd"); })).attributes.xEnd;
                      const rows = (() => {
                        const result = [];
                  Severity: Minor
                  Found in src/model/FeatureCol.js - About 45 mins 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 calcHiddenSeqs has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                    calcHiddenSeqs: function(n) {
                      let nNew = n;
                      for (let i = 0; 0 < nNew ? i <= nNew : i >= nNew; 0 < nNew ? i++ : i--) {
                        if (this.at(i).get("hidden")) {
                          nNew++;
                  Severity: Minor
                  Found in src/model/SeqCollection.js - About 35 mins 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