concord-consortium/rigse

View on GitHub

Showing 2,136 of 2,138 total issues

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

  hide: function() {
    if (!this.visible) return this;

    this.fire('hiding');
    this.effect('hide');
Severity: Major
Found in rails/app/assets/javascripts/livepipe/window.js and 2 other locations - About 7 hrs to fix
rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 3261..3283
rails/public/javascripts/light_box.js on lines 3261..3283

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

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

  hide: function() {
    if (!this.visible) return this;

    this.fire('hiding');
    this.effect('hide');
Severity: Major
Found in rails/public/javascripts/light_box.js and 2 other locations - About 7 hrs to fix
rails/app/assets/javascripts/livepipe/window.js on lines 1513..1535
rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 3261..3283

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

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

  setAjaxContent: function(url, options) {
    if (!options)
      options = {};

    // bind all callbacks to the window
Severity: Major
Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 7 hrs to fix
rails/public/javascripts/light_box.js on lines 3545..3563

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

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

  setAjaxContent: function(url, options) {
    if (!options)
      options = {};

    // bind all callbacks to the window
Severity: Major
Found in rails/public/javascripts/light_box.js and 1 other location - About 7 hrs to fix
rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 3545..3563

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

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

File dhtml_history.js has 474 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
Copyright (c) 2007 Brian Dillard and Brad Neuberg:
Brian Dillard | Project Lead | bdillard@pathf.com | http://blogs.pathf.com/agileajax/
Brad Neuberg | Original Project Creator | http://codinginparadise.org

Severity: Minor
Found in rails/app/assets/javascripts/active_scaffold/default/dhtml_history.js - About 7 hrs to fix

    Function Tokenizer has 182 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    PIE.Tokenizer = (function() {
        function Tokenizer( css ) {
            this.css = css;
            this.ch = 0;
            this.tokens = [];
    Severity: Major
    Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 7 hrs to fix

      File user.rb has 463 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require 'digest/sha1'
      
      class User < ApplicationRecord
        has_many :authentications, :dependent => :delete_all
        has_many :access_grants, :dependent => :delete_all
      Severity: Minor
      Found in rails/app/models/user.rb - About 7 hrs to fix

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

          onStartDrag: function(event) {
            var handle = event.element(),
                isMoveHandle   = handle.match(this.moveHandleSelector),
                isResizeHandle = handle.match(this.resizeHandleSelector);
        
        
        Severity: Major
        Found in rails/app/assets/javascripts/livepipe/window.js and 2 other locations - About 7 hrs to fix
        rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4719..4737
        rails/public/javascripts/light_box.js on lines 4719..4737

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

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

          onStartDrag: function(event) {
            var handle = event.element(),
                isMoveHandle   = handle.match(this.moveHandleSelector),
                isResizeHandle = handle.match(this.resizeHandleSelector);
        
        
        Severity: Major
        Found in rails/public/javascripts/light_box.js and 2 other locations - About 7 hrs to fix
        rails/app/assets/javascripts/livepipe/window.js on lines 2753..2771
        rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4719..4737

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

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

          onStartDrag: function(event) {
            var handle = event.element(),
                isMoveHandle   = handle.match(this.moveHandleSelector),
                isResizeHandle = handle.match(this.resizeHandleSelector);
        
        
        Severity: Major
        Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 7 hrs to fix
        rails/app/assets/javascripts/livepipe/window.js on lines 2753..2771
        rails/public/javascripts/light_box.js on lines 4719..4737

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

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

        const NgssHelper = function () {
          const PE = "Performance Expectations";
          const DCI = "Disciplinary Core Ideas";
          const PRACTICES = "Science and Engineering Practices";
          const CONCEPTS = "Crosscutting Concepts";
        Severity: Major
        Found in rails/react-components/src/library/helpers/standards-helpers.tsx - About 7 hrs to fix

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

                'width': function(element) {
                  if (!this._preComputing) this._begin();
          
                  var bWidth = this.get('border-box-width');
                  if (bWidth <= 0) {
          Severity: Major
          Found in rails/app/assets/javascripts/prototype.js and 1 other location - About 7 hrs to fix
          rails/app/assets/javascripts/prototype.js on lines 3780..3798

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

          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

                'height': function(element) {
                  if (!this._preComputing) this._begin();
          
                  var bHeight = this.get('border-box-height');
                  if (bHeight <= 0) {
          Severity: Major
          Found in rails/app/assets/javascripts/prototype.js and 1 other location - About 7 hrs to fix
          rails/app/assets/javascripts/prototype.js on lines 3800..3817

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

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

          UI.ElementLogger = Class.create(UI.Abstract.Logger, {
            /*
              Method: initialize
                Constructor, takes a DOM element to log into as argument
            */
          Severity: Major
          Found in rails/public/javascripts/light_box.js and 2 other locations - About 6 hrs to fix
          rails/app/assets/javascripts/livepipe/window.js on lines 850..878
          rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 2423..2451

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

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

          UI.ElementLogger = Class.create(UI.Abstract.Logger, {
            /*
              Method: initialize
                Constructor, takes a DOM element to log into as argument
            */
          Severity: Major
          Found in rails/app/assets/javascripts/livepipe/window.js and 2 other locations - About 6 hrs to fix
          rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 2423..2451
          rails/public/javascripts/light_box.js on lines 2423..2451

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

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

          UI.ElementLogger = Class.create(UI.Abstract.Logger, {
            /*
              Method: initialize
                Constructor, takes a DOM element to log into as argument
            */
          Severity: Major
          Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 6 hrs to fix
          rails/app/assets/javascripts/livepipe/window.js on lines 850..878
          rails/public/javascripts/light_box.js on lines 2423..2451

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

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

              plotLine: function(series, offset){
                  var ctx = this.ctx,
                      xa = series.xaxis,
                      ya = series.yaxis,
                        tHoz = this.tHoz.bind(this),
          Severity: Minor
          Found in rails/app/assets/javascripts/flotr/flotr_out.js - About 6 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 plotBars has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
          Open

              plotBars: function(series, barWidth, offset, fill){
                  var data = series.data;
                  if(data.length < 1) return;
                  
                  var xa = series.xaxis,
          Severity: Minor
          Found in rails/app/assets/javascripts/flotr/flotr_out.js - About 6 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 plotBars has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
          Open

              plotBars: function(series, barWidth, offset, fill){
                  var data = series.data;
                  if(data.length < 1) return;
                  
                  var xa = series.xaxis,
          Severity: Minor
          Found in rails/app/assets/javascripts/flotr/flotr.js - About 6 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 plotLine has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
          Open

              plotLine: function(series, offset){
                  var ctx = this.ctx,
                      xa = series.xaxis,
                      ya = series.yaxis,
                        tHoz = this.tHoz.bind(this),
          Severity: Minor
          Found in rails/app/assets/javascripts/flotr/flotr.js - About 6 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