wilzbach/msa

View on GitHub

Showing 67 of 149 total issues

Function render has 39 lines of code (exceeds 25 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 1 hr to fix

    Function getBlocksForRow has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      getBlocksForRow: function(seqId, maxLen) {
        const selis = this.filter(function(el) { return el.inRow(seqId); });
        let blocks = [];
        for (let i = 0, seli; i < selis.length; i++) {
          let seli = selis[i];
    Severity: Minor
    Found in src/g/selection/SelectionCol.js - About 1 hr to fix

      Function genConservedSequences has 37 lines of code (exceeds 25 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 1 hr to fix

        Function invertCol has 37 lines of code (exceeds 25 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 1 hr to fix

          Function _onmousemove has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

            _onmousemove: function(e, reversed) {
              if (this.dragStart.length === 0) { return; }
          
              const dragEnd = mouse.abs(e);
              // relative to first click
          Severity: Minor
          Found in src/views/canvas/CanvasSeqBlock.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 _renderSelection has a Cognitive Complexity of 12 (exceeds 5 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 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 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            render: function() {
              var gaps = this.g.stats.gaps();
          
              dom.removeAllChilds(this.el);
          
          
          Severity: Minor
          Found in src/views/header/GapView.js - About 1 hr to fix

            Function _appendSelection has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              _appendSelection: function(data) {
                const seq = data.model.get("seq");
                const selection = this._getSelection(data.model);
                // get the status of the upper and lower row
                const getNextPrev= this._getPrevNextSelection(data.model);
            Severity: Minor
            Found in src/views/canvas/CanvasSelection.js - About 1 hr to fix

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

                render: function() {
                  dom.removeAllChilds(this.el);
              
                  const fontSize = this.g.zoomer.get("markerFontsize");
                  const cellWidth = this.g.zoomer.get("columnWidth");
              Severity: Minor
              Found in src/views/header/MarkerView.js - About 1 hr to fix

                Function joinCb has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                  joinCb: function(retCb, finalLength, finalScope) {
                    finalLength = finalLength || 1;
                    var cbsFinished = 0;
                
                    var callbackWrapper = function(cb, scope) {
                Severity: Minor
                Found in src/utils/loader.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 a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                  render: function() {
                    var gaps = this.g.stats.gaps();
                
                    dom.removeAllChilds(this.el);
                
                
                Severity: Minor
                Found in src/views/header/GapView.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 drawFeature has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  drawFeature: function(data) {
                    var seq = data.model.get("seq");
                    var rectWidth = this.g.zoomer.get("columnWidth");
                    var rectHeight = this.g.zoomer.get("rowHeight");
                
                
                Severity: Minor
                Found in src/views/FeatureBlock.js - About 1 hr to fix

                  Function _onmousemove has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    _onmousemove: function(e, reversed) {
                      if (this.dragStart.length === 0) { return; }
                  
                      const dragEnd = mouse.abs(e);
                      // relative to first click
                  Severity: Minor
                  Found in src/views/canvas/CanvasSeqBlock.js - About 1 hr to fix

                    Function draw has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      draw: function() {
                    
                        this.removeViews();
                    
                        this.addView("stage",new Stage({model: this.seqs, g: this.g}));
                    Severity: Minor
                    Found in src/msa.js - About 1 hr to fix

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

                        render() {
                          this.setName("Selection");
                          this.addNode("Find Motif (supports RegEx)", () => {
                            var search = prompt("your search", "D");
                            return this.g.user.set("searchText", search);
                      Severity: Minor
                      Found in src/menu/views/SelectionMenu.js - About 1 hr to fix

                        Function markerHidden has 29 lines of code (exceeds 25 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 1 hr to fix

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

                            render: function() {
                              var msa = this.msa;
                              var uploader = k.mk("input");
                              uploader.type = "file";
                              uploader.style.display = "none";
                          Severity: Minor
                          Found in src/menu/views/ImportMenu.js - About 1 hr to fix

                            Function getAllColumnBlocks has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              getAllColumnBlocks: function(conf) {
                                const maxLen = conf.maxLen;
                                const withPos = conf.withPos;
                                let blocks = [];
                                let filtered;
                            Severity: Minor
                            Found in src/g/selection/SelectionCol.js - About 1 hr to fix

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

                                initialize: function(obj) {
                                  if ((obj.start != null)) {
                                    // gff counts from 1 where MSA starts at 0
                                    // This fix that misalignment
                                    this.set("xStart", (obj.start-1));
                              Severity: Minor
                              Found in src/model/Feature.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 a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                                render: function() {
                                  dom.removeAllChilds(this.el);
                              
                                  const fontSize = this.g.zoomer.get("markerFontsize");
                                  const cellWidth = this.g.zoomer.get("columnWidth");
                              Severity: Minor
                              Found in src/views/header/MarkerView.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