yannickwurm/sequenceserver

View on GitHub

Showing 7,450 of 7,450 total issues

File circosJS@1.7.0.js has 1590 lines of code (exceeds 1000 allowed). Consider refactoring.
Open

var circosJS,
    indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };

if (typeof Object.assign !== 'function') {
    Object.assign = function(target) {
Severity: Major
Found in public/packages/circosJS@1.7.0.js - About 2 days to fix

    Class has too many lines. [214/150]
    Open

      class MAKEBLASTDB
        extend Forwardable
        GUESS_SAMPLE_SIZE = 1_048_576
    
        def_delegators SequenceServer, :config, :sys
    Severity: Minor
    Found in lib/sequenceserver/makeblastdb.rb by rubocop

    This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

    You can set literals you want to fold with CountAsOne. Available are: 'array', 'hash', and 'heredoc'. Each literal will be counted as one line regardless of its actual size.

    Example: CountAsOne: ['array', 'heredoc']

    class Foo
      ARRAY = [         # +1
        1,
        2
      ]
    
      HASH = {          # +3
        key: 'value'
      }
    
      MSG = <<~HEREDOC  # +1
        Heredoc
        content.
      HEREDOC
    end                 # 5 points

    NOTE: This cop also applies for Struct definitions.

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

            _.each(
                this.hit_arr,
                _.bind(function (id, index) {
                    this.chordsHide = [];
                    this.layoutHide = [];
    Severity: Major
    Found in public/js/circos.js and 1 other location - About 1 day to fix
    public/js/circos.js on lines 489..518

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

    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

            _.each(
                this.query_arr,
                _.bind(function (id, index) {
                    this.chordsHide = [];
                    this.layoutHide = [];
    Severity: Major
    Found in public/js/circos.js and 1 other location - About 1 day to fix
    public/js/circos.js on lines 519..548

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

    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

    Class has too many lines. [192/150]
    Open

      class Routes < Sinatra::Base
        # See
        # http://www.sinatrarb.com/configuration.html
        configure do
          # We don't need Rack::MethodOverride. Let's avoid the overhead.
    Severity: Minor
    Found in lib/sequenceserver/routes.rb by rubocop

    This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

    You can set literals you want to fold with CountAsOne. Available are: 'array', 'hash', and 'heredoc'. Each literal will be counted as one line regardless of its actual size.

    Example: CountAsOne: ['array', 'heredoc']

    class Foo
      ARRAY = [         # +1
        1,
        2
      ]
    
      HASH = {          # +3
        key: 'value'
      }
    
      MSG = <<~HEREDOC  # +1
        Heredoc
        content.
      HEREDOC
    end                 # 5 points

    NOTE: This cop also applies for Struct definitions.

    Class has too many lines. [191/150]
    Open

        class Report < Report
          def initialize(job)
            super do
              @querydb = job.databases
            end
    Severity: Minor
    Found in lib/sequenceserver/blast/report.rb by rubocop

    This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

    You can set literals you want to fold with CountAsOne. Available are: 'array', 'hash', and 'heredoc'. Each literal will be counted as one line regardless of its actual size.

    Example: CountAsOne: ['array', 'heredoc']

    class Foo
      ARRAY = [         # +1
        1,
        2
      ]
    
      HASH = {          # +3
        key: 'value'
      }
    
      MSG = <<~HEREDOC  # +1
        Heredoc
        content.
      HEREDOC
    end                 # 5 points

    NOTE: This cop also applies for Struct definitions.

    Function Track has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
    Open

    circosJS.Track = function() {
        this.build = function(instance, conf, data) {
            this.dispatch = d3.dispatch('mouseover', 'mouseout');
            this.loadData(data, instance);
            this.conf = this.processConf(conf, this.defaultConf, this.meta, instance, this);
    Severity: Minor
    Found in public/packages/circosJS@1.7.0.js - About 1 day 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 Track has 214 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    circosJS.Track = function() {
        this.build = function(instance, conf, data) {
            this.dispatch = d3.dispatch('mouseover', 'mouseout');
            this.loadData(data, instance);
            this.conf = this.processConf(conf, this.defaultConf, this.meta, instance, this);
    Severity: Major
    Found in public/packages/circosJS@1.7.0.js - About 1 day to fix

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

          this.y = (function(_this) {
              return function(d, layout, conf) {
                  var angle, height, r;
                  height = _this.ratio(d.value, conf.cmin, conf.cmax, conf.outerRadius - conf.innerRadius, false, conf.logscale);
                  if (conf.direction === 'in') {
      Severity: Major
      Found in public/packages/circosJS@1.7.0.js and 1 other location - About 1 day to fix
      public/packages/circosJS@1.7.0.js on lines 1210..1222

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

      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

          this.ratio = function(value, min, max, scope, reverse, logScale) {
              var fraction, scaleLogBase, x;
              scaleLogBase = logScale ? 2.3 : 1;
              if (min === max || (value === min && !reverse) || (value === max && reverse)) {
                  return 0;
      Severity: Major
      Found in public/packages/circosJS@1.7.0.js and 1 other location - About 1 day to fix
      public/packages/circosJS@1.7.0.js on lines 1104..1119

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

      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

          this.x = (function(_this) {
              return function(d, layout, conf) {
                  var angle, height, r;
                  height = _this.ratio(d.value, conf.cmin, conf.cmax, conf.outerRadius - conf.innerRadius, false, conf.logscale);
                  if (conf.direction === 'in') {
      Severity: Major
      Found in public/packages/circosJS@1.7.0.js and 1 other location - About 1 day to fix
      public/packages/circosJS@1.7.0.js on lines 1223..1235

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

      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

          this.ratio = function(value, min, max, scope, reverse, logScale) {
              var fraction, scaleLogBase, x;
              scaleLogBase = logScale ? 2.3 : 1;
              if (min === max || (value === min && !reverse) || (value === max && reverse)) {
                  return 0;
      Severity: Major
      Found in public/packages/circosJS@1.7.0.js and 1 other location - About 1 day to fix
      public/packages/circosJS@1.7.0.js on lines 1236..1251

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

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

      circosJS.Stack = function() {
          circosJS.Track.call(this);
          this.parseData = circosJS.parseSpanValueData;
          this.build = function(instance, conf, data, rules, backgrounds) {
              this.loadData(data, instance);
      Severity: Minor
      Found in public/packages/circosJS@1.7.0.js - About 1 day 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

          this.getTarget = (function(_this) {
              return function(d, layout) {
                  var block, endAngle, result, startAngle;
                  d = d.target;
                  block = layout.blocks[d.id];
      Severity: Major
      Found in public/packages/circosJS@1.7.0.js and 1 other location - About 7 hrs to fix
      public/packages/circosJS@1.7.0.js on lines 578..591

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

      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

          this.getSource = (function(_this) {
              return function(d, layout) {
                  var block, endAngle, result, startAngle;
                  d = d.source;
                  block = layout.blocks[d.id];
      Severity: Major
      Found in public/packages/circosJS@1.7.0.js and 1 other location - About 7 hrs to fix
      public/packages/circosJS@1.7.0.js on lines 592..605

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

      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

                              for (l = 0, len = layer.length; l < len; l++) {
                                  datum = layer[l];
                                  results2.push((function() {
                                      var len1, m, results3;
                                      results3 = [];
      Severity: Major
      Found in public/packages/circosJS@1.7.0.js and 1 other location - About 6 hrs to fix
      public/packages/circosJS@1.7.0.js on lines 1078..1093

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

      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

                      for (i in ref) {
                          datum = ref[i];
                          results1.push((function() {
                              var l, len, results2;
                              results2 = [];
      Severity: Major
      Found in public/packages/circosJS@1.7.0.js and 1 other location - About 6 hrs to fix
      public/packages/circosJS@1.7.0.js on lines 910..925

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

      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 Stack has 158 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      circosJS.Stack = function() {
          circosJS.Track.call(this);
          this.parseData = circosJS.parseSpanValueData;
          this.build = function(instance, conf, data, rules, backgrounds) {
              this.loadData(data, instance);
      Severity: Major
      Found in public/packages/circosJS@1.7.0.js - About 6 hrs to fix

        Function graphIt has 140 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            graphIt($queryDiv, $graphDiv, index, howMany, opts, inhits) {
            /* barHeight: Height of each hit track.
             * legend: Height reserved for the overview legend.
             * margin: Margin around the svg element.
             */
        Severity: Major
        Found in public/js/hits_overview.js - About 5 hrs to fix

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

              var colors = d3.scale
                  .log()
                  .domain([
                      d3.min([1e-5, d3.min(hits.map(function (d) {
                          if (parseFloat(d.evalue) === 0.0) return undefined;
          Severity: Major
          Found in public/js/visualisation_helpers.js and 1 other location - About 4 hrs to fix
          public/js/hits_overview.js on lines 305..317

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

          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