wurmlab/sequenceserver

View on GitHub

Showing 7,605 of 7,605 total issues

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

circosJS.Core.prototype.highlight = function(id, conf, data) {
    var track;
    track = new circosJS.Highlight();
    track.build(this, conf, data);
    this.tracks.highlights[id] = track;
Severity: Major
Found in public/packages/circosJS@1.7.0.js and 7 other locations - About 2 hrs to fix
public/packages/circosJS@1.7.0.js on lines 489..495
public/packages/circosJS@1.7.0.js on lines 497..503
public/packages/circosJS@1.7.0.js on lines 505..511
public/packages/circosJS@1.7.0.js on lines 513..519
public/packages/circosJS@1.7.0.js on lines 521..527
public/packages/circosJS@1.7.0.js on lines 529..535
public/packages/circosJS@1.7.0.js on lines 545..551

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

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 8 locations. Consider refactoring.
Open

circosJS.Core.prototype.histogram = function(id, conf, data) {
    var track;
    track = new circosJS.Histogram();
    track.build(this, conf, data);
    this.tracks.histograms[id] = track;
Severity: Major
Found in public/packages/circosJS@1.7.0.js and 7 other locations - About 2 hrs to fix
public/packages/circosJS@1.7.0.js on lines 489..495
public/packages/circosJS@1.7.0.js on lines 505..511
public/packages/circosJS@1.7.0.js on lines 513..519
public/packages/circosJS@1.7.0.js on lines 521..527
public/packages/circosJS@1.7.0.js on lines 529..535
public/packages/circosJS@1.7.0.js on lines 537..543
public/packages/circosJS@1.7.0.js on lines 545..551

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

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 8 locations. Consider refactoring.
Open

circosJS.Core.prototype.stack = function(id, conf, data) {
    var track;
    track = new circosJS.Stack();
    track.build(this, conf, data);
    this.tracks.stacks[id] = track;
Severity: Major
Found in public/packages/circosJS@1.7.0.js and 7 other locations - About 2 hrs to fix
public/packages/circosJS@1.7.0.js on lines 489..495
public/packages/circosJS@1.7.0.js on lines 497..503
public/packages/circosJS@1.7.0.js on lines 505..511
public/packages/circosJS@1.7.0.js on lines 513..519
public/packages/circosJS@1.7.0.js on lines 521..527
public/packages/circosJS@1.7.0.js on lines 537..543
public/packages/circosJS@1.7.0.js on lines 545..551

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

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 8 locations. Consider refactoring.
Open

circosJS.Core.prototype.heatmap = function(id, conf, data) {
    var track;
    track = new circosJS.Heatmap();
    track.build(this, conf, data);
    this.tracks.heatmaps[id] = track;
Severity: Major
Found in public/packages/circosJS@1.7.0.js and 7 other locations - About 2 hrs to fix
public/packages/circosJS@1.7.0.js on lines 497..503
public/packages/circosJS@1.7.0.js on lines 505..511
public/packages/circosJS@1.7.0.js on lines 513..519
public/packages/circosJS@1.7.0.js on lines 521..527
public/packages/circosJS@1.7.0.js on lines 529..535
public/packages/circosJS@1.7.0.js on lines 537..543
public/packages/circosJS@1.7.0.js on lines 545..551

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

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 8 locations. Consider refactoring.
Open

circosJS.Core.prototype.scatter = function(id, conf, data) {
    var track;
    track = new circosJS.Scatter();
    track.build(this, conf, data);
    this.tracks.scatters[id] = track;
Severity: Major
Found in public/packages/circosJS@1.7.0.js and 7 other locations - About 2 hrs to fix
public/packages/circosJS@1.7.0.js on lines 489..495
public/packages/circosJS@1.7.0.js on lines 497..503
public/packages/circosJS@1.7.0.js on lines 505..511
public/packages/circosJS@1.7.0.js on lines 521..527
public/packages/circosJS@1.7.0.js on lines 529..535
public/packages/circosJS@1.7.0.js on lines 537..543
public/packages/circosJS@1.7.0.js on lines 545..551

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

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 8 locations. Consider refactoring.
Open

circosJS.Core.prototype.text = function(id, conf, data) {
    var track;
    track = new circosJS.Text();
    track.build(this, conf, data);
    this.tracks.texts[id] = track;
Severity: Major
Found in public/packages/circosJS@1.7.0.js and 7 other locations - About 2 hrs to fix
public/packages/circosJS@1.7.0.js on lines 489..495
public/packages/circosJS@1.7.0.js on lines 497..503
public/packages/circosJS@1.7.0.js on lines 505..511
public/packages/circosJS@1.7.0.js on lines 513..519
public/packages/circosJS@1.7.0.js on lines 521..527
public/packages/circosJS@1.7.0.js on lines 529..535
public/packages/circosJS@1.7.0.js on lines 537..543

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

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 8 locations. Consider refactoring.
Open

circosJS.Core.prototype.line = function(id, conf, data) {
    var track;
    track = new circosJS.Line();
    track.build(this, conf, data);
    this.tracks.lines[id] = track;
Severity: Major
Found in public/packages/circosJS@1.7.0.js and 7 other locations - About 2 hrs to fix
public/packages/circosJS@1.7.0.js on lines 489..495
public/packages/circosJS@1.7.0.js on lines 497..503
public/packages/circosJS@1.7.0.js on lines 505..511
public/packages/circosJS@1.7.0.js on lines 513..519
public/packages/circosJS@1.7.0.js on lines 529..535
public/packages/circosJS@1.7.0.js on lines 537..543
public/packages/circosJS@1.7.0.js on lines 545..551

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

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 8 locations. Consider refactoring.
Open

circosJS.Core.prototype.chord = function(id, conf, data) {
    var track;
    track = new circosJS.Chord();
    track.build(this, conf, data);
    this.tracks.chords[id] = track;
Severity: Major
Found in public/packages/circosJS@1.7.0.js and 7 other locations - About 2 hrs to fix
public/packages/circosJS@1.7.0.js on lines 489..495
public/packages/circosJS@1.7.0.js on lines 497..503
public/packages/circosJS@1.7.0.js on lines 513..519
public/packages/circosJS@1.7.0.js on lines 521..527
public/packages/circosJS@1.7.0.js on lines 529..535
public/packages/circosJS@1.7.0.js on lines 537..543
public/packages/circosJS@1.7.0.js on lines 545..551

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

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

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

    if ('parent_id' in sample && 'start' in sample && 'end' in sample && 'value' in sample) {
        data = data.map(function(datum) {
            return [datum.parent_id, datum.start, datum.end, datum.value];
        });
    }
Severity: Major
Found in public/packages/circosJS@1.7.0.js and 1 other location - About 2 hrs to fix
public/packages/circosJS@1.7.0.js on lines 258..262

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

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

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

    if ('parent_id' in sample && 'start' in sample && 'end' in sample && 'value' in sample) {
        data = data.map(function(datum) {
            return [datum.parent_id, datum.start, datum.end, datum.value];
        });
    }
Severity: Major
Found in public/packages/circosJS@1.7.0.js and 1 other location - About 2 hrs to fix
public/packages/circosJS@1.7.0.js on lines 212..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 80.

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 has too many lines. [20/15]
Open

def ask_to_join
  asked_to_join = File.join(SequenceServer::DOTDIR, 'asked_to_join')
  unless File.exist?(asked_to_join)
    puts
    puts <<~MSG
Severity: Minor
Found in bin/sequenceserver by rubocop

This cop checks if the length of a method 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.

NOTE: The ExcludedMethods configuration is deprecated and only kept for backwards compatibility. Please use IgnoredMethods instead.

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

def m
  array = [       # +1
    1,
    2
  ]

  hash = {        # +3
    key: 'value'
  }

  <<~HEREDOC      # +1
    Heredoc
    content.
  HEREDOC
end               # 5 points

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

    render() {
        var methods = this.state.methods;
        var method = methods[0];
        var multi = methods.length > 1;

Severity: Major
Found in public/js/search_button.js - About 2 hrs to fix

    Function Layout has 55 lines of code (exceeds 25 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: Major
    Found in public/packages/circosJS@1.7.0.js - About 2 hrs to fix

      Method has too many lines. [19/15]
      Open

            def tree
              all.each_with_object({}) do |db, data|
                data[db.type] ||= []
                use_parent = '#'
                db.categories.each_with_index do |entry, index|
      Severity: Minor
      Found in lib/sequenceserver/database.rb by rubocop

      This cop checks if the length of a method 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.

      NOTE: The ExcludedMethods configuration is deprecated and only kept for backwards compatibility. Please use IgnoredMethods instead.

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

      def m
        array = [       # +1
          1,
          2
        ]
      
        hash = {        # +3
          key: 'value'
        }
      
        <<~HEREDOC      # +1
          Heredoc
          content.
        HEREDOC
      end               # 5 points

      Function draw_axes has 53 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          draw_axes() {
              var space, len;
              len = this._scale_y.ticks().length;
              if (len >= 5) {
                  space = 5;
      Severity: Major
      Found in public/js/length_distribution.js - About 2 hrs to fix

        Function hspStats has 53 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          hspStats() {
            // An array to hold text or span elements that make up the line.
            let line = [];
        
            // Bit score and total score.
        Severity: Major
        Found in public/js/hsp.js - About 2 hrs to fix

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

                  _.each(
                      this.new_layout,
                      _.bind(function (obj) {
                          var id = obj.id.slice(0, 3);
                          if (id == 'Que') {
          Severity: Major
          Found in public/js/circos.js and 1 other location - About 2 hrs to fix
          public/js/circos.js on lines 175..183

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

          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.new_layout,
                      _.bind(function (obj) {
                          var id = obj.id.slice(0, 3);
                          if (id == 'Hit') {
          Severity: Major
          Found in public/js/circos.js and 1 other location - About 2 hrs to fix
          public/js/circos.js on lines 166..174

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

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

              Object.assign = function(target) {
                  'use strict';
                  var index, key, source;
                  if (target === null) {
                      throw new TypeError('Cannot convert undefined or null to object');
          Severity: Minor
          Found in public/packages/circosJS@1.7.0.js - About 2 hrs 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 16 (exceeds 5 allowed). Consider refactoring.
          Open

          circosJS.Core.prototype.render = function(ids, removeTracks) {
              var name, ref, ref1, renderAll, svg, track, trackStore, trackType, tracks, translated;
              if (typeof ids === 'undefined') {
                  renderAll = true;
                  ids = [];
          Severity: Minor
          Found in public/packages/circosJS@1.7.0.js - About 2 hrs 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