wurmlab/sequenceserver

View on GitHub

Showing 16,957 of 16,957 total issues

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

    line.push(
      `Gaps: ${Utils.inFraction(
        hsp.gaps,
        hsp.length
      )} (${Utils.inPercentage(hsp.gaps, hsp.length)})`
Severity: Major
Found in public/js/hsp.js and 1 other location - About 1 hr to fix
public/js/hsp.js on lines 85..90

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 ratioCalculate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    ratioCalculate(value, min, max, scope, reverse, logScale) {
        var fraction, scaleLogBase, x;
        scaleLogBase = logScale ? 2.3 : 1;
        if (
            min === max ||
Severity: Minor
Found in public/js/circos.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 handleLoadTree has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    handleLoadTree(category) {
        var tree_id = '#' + category + '_database_tree';
        // hack that is needed to sync the selected tree db with the hidden main db
        window.jstree_node_change_timeout = null;
        window.jstree_rapid_timeout = null
Severity: Minor
Found in public/js/databases_tree.js - About 1 hr to fix

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

    circosJS.Core.prototype.removeTracks = function(trackIds) {
        var id, l, len, ref, store, svg, trackId, type;
        svg = d3.select(this.conf.container);
        ref = this.tracks;
        for (type in ref) {
    Severity: Minor
    Found in public/js/circosjs.js - About 1 hr to fix

      Function renderChords has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          this.renderChords = function(parentElement, name, conf, data, layout, ratio, getSource, getTarget) {
      Severity: Major
      Found in public/js/circosjs.js - About 1 hr to fix

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

                var bar = this.svg.selectAll('.bar')
                    .data(this._update_data)
                    .enter().append('g')
                    .attr('class', 'g')
                    .attr('transform', function(d) {
        Severity: Minor
        Found in public/js/length_distribution.js and 1 other location - About 55 mins to fix
        public/js/circos.js on lines 644..652

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

        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

                var bar = this.legend
                    .selectAll('.bar')
                    .data(this.ratioHSP)
                    .enter()
                    .append('g')
        Severity: Minor
        Found in public/js/circos.js and 1 other location - About 55 mins to fix
        public/js/length_distribution.js on lines 146..152

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

        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

        Method retrieve has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

              def retrieve(loci)
                # Exit early if loci is nil.
                return unless loci
        
                # String -> Array
        Severity: Minor
        Found in lib/sequenceserver/database.rb - 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 Layout has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

        circosJS.Layout = function(conf, data) {
            var block_nb, gap, k, offset, ref, ref1, size, v;
            if (data == null) {
                circosJS.log(2, 'no layout data', '');
            }
        Severity: Minor
        Found in public/js/circosjs.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

        Method init_database has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def init_database
              fail DATABASE_DIR_NOT_SET unless config[:database_dir]
        
              config[:database_dir] = File.expand_path(config[:database_dir])
              unless File.exist?(config[:database_dir]) &&
        Severity: Minor
        Found in lib/sequenceserver.rb - 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

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

                var subject_axis = this._create_axis(this._scales.subject.scale, 'bottom',
                    this._scales.subject.height, 'end',   '-11px',  '3px',
                    this._results.subject_seq_type);
        Severity: Minor
        Found in public/js/kablammo.js and 1 other location - About 55 mins to fix
        public/js/kablammo.js on lines 255..257

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

        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

                var query_axis = this._create_axis(this._scales.query.scale,   'top',
                    this._scales.query.height,   'start', '9px', '2px',
                    this._results.query_seq_type);
        Severity: Minor
        Found in public/js/kablammo.js and 1 other location - About 55 mins to fix
        public/js/kablammo.js on lines 258..260

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

        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

        Method parse_advanced has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

              def parse_advanced(param_line)
                param_list = (param_line || '').split(' ')
                res = {}
        
                param_list.each_with_index do |word, i|
        Severity: Minor
        Found in lib/sequenceserver/blast/report.rb - 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 ratio has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            this.ratio = function(value, min, max, scope, reverse, logScale) {
        Severity: Minor
        Found in public/js/circosjs.js - About 45 mins to fix

          Method open_in_browser has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              def open_in_browser(server_url)
                return if using_ssh? || verbose?
                if RUBY_PLATFORM =~ /linux/ && xdg?
                  sys("xdg-open #{server_url}")
                elsif RUBY_PLATFORM =~ /darwin/
          Severity: Minor
          Found in lib/sequenceserver.rb - 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 (Object.prototype.hasOwnProperty.call(source, key)) {
                                  target[key] = source[key];
                              }
          Severity: Major
          Found in public/js/circosjs.js - About 45 mins to fix

            Function ratio has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                this.ratio = function(value, min, max, scope, reverse, logScale) {
            Severity: Minor
            Found in public/js/circosjs.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                          for (trackId in store) {
                              svg.select('.' + trackId).remove();
                              delete store[trackId];
                          }
              Severity: Major
              Found in public/js/circosjs.js - About 45 mins to fix

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

                                    var subject_x_points = [self._scales.subject.scale(hsp.sstart), self._scales.subject.scale(hsp.send)];
                Severity: Minor
                Found in public/js/kablammo.js and 1 other location - About 45 mins to fix
                public/js/kablammo.js on lines 215..215

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

                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

                                    var query_x_points = [self._scales.query.scale(hsp.qstart), self._scales.query.scale(hsp.qend)];
                Severity: Minor
                Found in public/js/kablammo.js and 1 other location - About 45 mins to fix
                public/js/kablammo.js on lines 216..216

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

                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

                Severity
                Category
                Status
                Source
                Language