wilzbach/msa

View on GitHub

Showing 149 of 149 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    if (this.g.vis.get("labelId")) {
      labelHeader.appendChild(this.addEl("ID", this.g.zoomer.get("labelIdLength")));
    }
Severity: Major
Found in src/views/header/LabelHeader.js and 1 other location - About 1 hr to fix
src/views/header/LabelHeader.js on lines 78..80

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 59.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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 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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          if (this.g.vis.get("metaGaps")) {
            metaHeader.appendChild(this.addEl("Gaps", this.g.zoomer.get('metaGapWidth')));
          }
      Severity: Major
      Found in src/views/header/LabelHeader.js and 1 other location - About 1 hr to fix
      src/views/header/LabelHeader.js on lines 46..48

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 59.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      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 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 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

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

              _onmousein: function(evt) {
                var seqId = this.model.get("id");
                return this.g.trigger("row:mouseout", {seqId:seqId, evt:evt});
              },
            Severity: Major
            Found in src/views/labels/LabelView.js and 2 other locations - About 1 hr to fix
            src/views/labels/LabelView.js on lines 84..87
            src/views/labels/LabelView.js on lines 94..97

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 57.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                buildMenu: function(menu) {
                  if ((this.g != null)) {
                    return menu.style.fontSize = this.g.menuconfig.get("menuItemFontsize");
                  }
                }
            Severity: Major
            Found in src/menu/menubuilder.js and 1 other location - About 1 hr to fix
            src/menu/menubuilder.js on lines 12..16

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 57.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

              _onclick: function(evt) {
                var seqId = this.model.get("id");
                return this.g.trigger("row:click", {seqId:seqId, evt:evt});
              },
            Severity: Major
            Found in src/views/labels/LabelView.js and 2 other locations - About 1 hr to fix
            src/views/labels/LabelView.js on lines 89..92
            src/views/labels/LabelView.js on lines 94..97

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 57.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                buildNode: function(li) {
                  if ((this.g != null)) {
                    return li.style.lineHeight = this.g.menuconfig.get("menuItemLineHeight");
                  }
                },
            Severity: Major
            Found in src/menu/menubuilder.js and 1 other location - About 1 hr to fix
            src/menu/menubuilder.js on lines 26..30

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 57.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

              _onmouseout: function(evt) {
                var seqId = this.model.get("id");
                return this.g.trigger("row:mouseout", {seqId:seqId, evt:evt});
              }
            Severity: Major
            Found in src/views/labels/LabelView.js and 2 other locations - About 1 hr to fix
            src/views/labels/LabelView.js on lines 84..87
            src/views/labels/LabelView.js on lines 89..92

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 57.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            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

            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 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 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
                    Severity
                    Category
                    Status
                    Source
                    Language