concord-consortium/rigse

View on GitHub

Showing 2,136 of 2,138 total issues

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

document.whenReady = (function() {
  var queue = [ ];

  document.observe('dom:loaded', function() {
    queue.invoke('call', document);
Severity: Major
Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 4 hrs to fix
rails/public/javascripts/light_box.js on lines 265..275

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

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

document.whenReady = (function() {
  var queue = [ ];

  document.observe('dom:loaded', function() {
    queue.invoke('call', document);
Severity: Major
Found in rails/public/javascripts/light_box.js and 1 other location - About 4 hrs to fix
rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 265..275

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

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 active_scaffold.js has 344 lines of code (exceeds 250 allowed). Consider refactoring.
Open

if (typeof Prototype == 'undefined')
{
  warning = "ActiveScaffold Error: Prototype could not be found. Please make sure that your application's layout includes prototype.js (e.g. <%= javascript_include_tag :defaults %>) *before* it includes active_scaffold.js (e.g. <%= active_scaffold_includes %>).";
  alert(warning);
}

    Function CSS has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

    var CSS = (function() {
      // Code based on:
      //   - IE5.5+ PNG Alpha Fix v1.0RC4 (c) 2004-2005 Angus Turnbull http://www.twinhelix.com
      //   - Whatever:hover - V2.02.060206 - hover, active & focus (c) 2005 - Peter Nederlof * Peterned - http://www.xs4all.nl/~peterned/
      function fixPNG() {
    Severity: Minor
    Found in rails/public/javascripts/light_box.js - About 4 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 CSS has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

    var CSS = (function() {
      // Code based on:
      //   - IE5.5+ PNG Alpha Fix v1.0RC4 (c) 2004-2005 Angus Turnbull http://www.twinhelix.com
      //   - Whatever:hover - V2.02.060206 - hover, active & focus (c) 2005 - Peter Nederlof * Peterned - http://www.xs4all.nl/~peterned/
      function fixPNG() {
    Severity: Minor
    Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 4 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

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

    Object.extend(document.viewport, {
      // Alias this method for consistency
      getScrollOffset: document.viewport.getScrollOffsets,
    
      setScrollOffset: function(offset) {
    Severity: Major
    Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 4 hrs to fix
    rails/public/javascripts/light_box.js on lines 277..288

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

    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

    Object.extend(document.viewport, {
      // Alias this method for consistency
      getScrollOffset: document.viewport.getScrollOffsets,
    
      setScrollOffset: function(offset) {
    Severity: Major
    Found in rails/public/javascripts/light_box.js and 1 other location - About 4 hrs to fix
    rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 277..288

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

    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

      def self.up
        create_table :bj_config, :primary_key => "bj_config_id", :force => true do |t|
          t.text :hostname
          t.text :key
          t.text :value
    Severity: Major
    Found in rails/db/migrate/20100212154213_bj_migration0.rb and 1 other location - About 4 hrs to fix
    rails/db/migrate/20110920032143_remove_bj.rb on lines 8..53

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

    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

      def self.down
        create_table :bj_config, :primary_key => "bj_config_id", :force => true do |t|
          t.text :hostname
          t.text :key
          t.text :value
    Severity: Major
    Found in rails/db/migrate/20110920032143_remove_bj.rb and 1 other location - About 4 hrs to fix
    rails/db/migrate/20100212154213_bj_migration0.rb on lines 3..48

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 144.

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

            next: function( forget ) {
                var css, ch, firstChar, match, val,
                    me = this;
    
                function newToken( type, value ) {
    Severity: Major
    Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 4 hrs to fix

      Function setOptions has 105 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  "setOptions": function(opts) {
      
                      var parseFormat = function(format) {
      
                          var gndx = 0, group = 0, num = 1, res = {
      Severity: Major
      Found in rails/app/assets/javascripts/jquery.paging.js - About 4 hrs to fix

        Function init has 104 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                function init() {
                    if( !initialized ) {
                        var docEl,
                            bounds,
                            ieDocMode = PIE.ieDocMode,
        Severity: Major
        Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 4 hrs to fix

          Function hit has 104 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              hit: function(mouse){
                  var series = this.series,
                      options = this.options,
                      prevHit = this.prevHit,
                      plotOffset = this.plotOffset,
          Severity: Major
          Found in rails/app/assets/javascripts/flotr/flotr_out.js - About 4 hrs to fix

            Function hit has 104 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                hit: function(mouse){
                    var series = this.series,
                        options = this.options,
                        prevHit = this.prevHit,
                        plotOffset = this.plotOffset,
            Severity: Major
            Found in rails/app/assets/javascripts/flotr/flotr.js - About 4 hrs to fix

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

                                  if( tokens[1].tokenType & type_ident ) {
                                      if( tokens[1].tokenValue === 'center' ) {
                                          vals[3] = length_fifty;
                                      } else {
                                          vals[2] = tokens[1].tokenValue;
              Severity: Major
              Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js and 1 other location - About 4 hrs to fix
              rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 685..694

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

              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

                                  if( tokens[0].tokenType & type_ident ) {
                                      if( tokens[0].tokenValue === 'center' ) {
                                          vals[1] = length_fifty;
                                      } else {
                                          vals[0] = tokens[0].tokenValue;
              Severity: Major
              Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js and 1 other location - About 4 hrs to fix
              rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 695..704

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

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

                  plotBarsShadows: function(series, barWidth, offset){
                      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 4 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 setOptions has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
              Open

                setOptions: function(options) {
                  this.options = Object.extend({
                    choices: 10,
                    partialSearch: true,
                    partialChars: 2,
              Severity: Minor
              Found in rails/app/assets/javascripts/controls.js - About 4 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 plotBarsShadows has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
              Open

                  plotBarsShadows: function(series, barWidth, offset){
                      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 4 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

              Method grep_files has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
              Open

              def grep_files(directory, blocks, new_blocks)
                original_dir = Dir.pwd
                if(directory == "lib")
                  Dir.chdir "../lib"
                  glob = '**/*.rb'
              Severity: Minor
              Found in rails/script/reference-tree.rb - About 4 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