concord-consortium/rigse

View on GitHub

Showing 2,136 of 2,138 total issues

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

UI.Benchmark = {
  benchmark: function(lambda, iterations) {
    var date = new Date();
    (iterations || 1).times(lambda);
    return (new Date() - date) / 1000;
Severity: Major
Found in rails/app/assets/javascripts/livepipe/window.js and 2 other locations - About 1 hr to fix
rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 1872..1878
rails/public/javascripts/light_box.js on lines 1872..1878

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

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

UI.Benchmark = {
  benchmark: function(lambda, iterations) {
    var date = new Date();
    (iterations || 1).times(lambda);
    return (new Date() - date) / 1000;
Severity: Major
Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 1 hr to fix
rails/app/assets/javascripts/livepipe/window.js on lines 505..511
rails/public/javascripts/light_box.js on lines 1872..1878

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

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

      'border-box-width': function(element) {
        if (!this._preComputing) this._begin();
        var width = element.offsetWidth;
        if (!this._preComputing) this._end();
        return width;
Severity: Major
Found in rails/app/assets/javascripts/prototype.js and 1 other location - About 1 hr to fix
rails/app/assets/javascripts/prototype.js on lines 3835..3840

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

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

UI.Benchmark = {
  benchmark: function(lambda, iterations) {
    var date = new Date();
    (iterations || 1).times(lambda);
    return (new Date() - date) / 1000;
Severity: Major
Found in rails/public/javascripts/light_box.js and 2 other locations - About 1 hr to fix
rails/app/assets/javascripts/livepipe/window.js on lines 505..511
rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 1872..1878

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

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

function base64decode(str) {
    var c1, c2, c3, c4;
    var i, len, out;

    len = str.length;
Severity: Minor
Found in rails/app/assets/javascripts/flotr/base64.js - About 1 hr to fix

    Function extendXRangeIfNeededByBar has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        extendXRangeIfNeededByBar: function(axis){
            if(axis.options.max == null){
                var newmin = axis.min,
                    newmax = axis.max,
                    i, s, b, c,
    Severity: Minor
    Found in rails/app/assets/javascripts/flotr/flotr_out.js - About 1 hr to fix

      Function extendXRangeIfNeededByBar has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          extendXRangeIfNeededByBar: function(axis){
              if(axis.options.max == null){
                  var newmin = axis.min,
                      newmax = axis.max,
                      i, s, b, c,
      Severity: Minor
      Found in rails/app/assets/javascripts/flotr/flotr.js - About 1 hr to fix

        Function setup has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          setup: function(){
            function parseColor(color){
              if (!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff';
              color = color.parseColor();
              return $R(0,2).map(function(i){
        Severity: Minor
        Found in rails/app/assets/javascripts/effects.js - About 1 hr to fix

          Method selector_for has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def selector_for(locator)
              case locator
          
              when "the page"
                "html > body"
          Severity: Minor
          Found in rails/features/support/selectors.rb - About 1 hr to fix

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

              render () {
                const resourceName = this.props.resourceName;
                const license = this.props.license_info;
                const credits = this.props.credits;
            
            

              Function renderResultsHeader has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                renderResultsHeader () {
                  const { displayLimit, noResourcesFound, numTotalResources, searching, usersAuthoredResourcesCount } = this.state;
                  const finderHeaderClass = this.isAdvancedUser() || usersAuthoredResourcesCount > 0 ? `${css.finderHeader} ${css.advanced}` : css.finderHeader;
              
                  if (noResourcesFound || searching) {
              Severity: Minor
              Found in rails/react-components/src/library/components/stem-finder.tsx - About 1 hr to fix

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

                  onDrag: function(event) {
                    if (this.draggedWindow) {
                      event.stop();
                      this.draggedWindow.drag(event.memo.dx, event.memo.dy);
                    }
                Severity: Major
                Found in rails/app/assets/javascripts/livepipe/window.js and 2 other locations - About 1 hr to fix
                rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4739..4744
                rails/public/javascripts/light_box.js on lines 4739..4744

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

                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() {
                  window.$head = $(document.getElementsByTagName('head')[0]);
                  window.$body = $(document.body);
                });
                Severity: Major
                Found in rails/public/javascripts/light_box.js and 1 other location - About 1 hr to fix
                rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 290..293

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

                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

                  onDrag: function(event) {
                    if (this.draggedWindow) {
                      event.stop();
                      this.draggedWindow.drag(event.memo.dx, event.memo.dy);
                    }
                Severity: Major
                Found in rails/public/javascripts/light_box.js and 2 other locations - About 1 hr to fix
                rails/app/assets/javascripts/livepipe/window.js on lines 2773..2778
                rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4739..4744

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

                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

                  onDrag: function(event) {
                    if (this.draggedWindow) {
                      event.stop();
                      this.draggedWindow.drag(event.memo.dx, event.memo.dy);
                    }
                Severity: Major
                Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 1 hr to fix
                rails/app/assets/javascripts/livepipe/window.js on lines 2773..2778
                rails/public/javascripts/light_box.js on lines 4739..4744

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

                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

                  register: function(win) {
                    if (this.getWindow(win.id)) return;
                
                    this.handlePosition(win);
                    this.stack.add(win);
                Severity: Major
                Found in rails/public/javascripts/light_box.js and 2 other locations - About 1 hr to fix
                rails/app/assets/javascripts/livepipe/window.js on lines 2659..2665
                rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4619..4625

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

                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() {
                  window.$head = $(document.getElementsByTagName('head')[0]);
                  window.$body = $(document.body);
                });
                Severity: Major
                Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 1 other location - About 1 hr to fix
                rails/public/javascripts/light_box.js on lines 290..293

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

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

                Object.extend(Number.prototype, {
                  // Snap a number to a grid
                  snap: function(round) {
                    return parseInt(round == 1 ? this : (this / round).floor() * round);
                  }
                Severity: Major
                Found in rails/public/javascripts/light_box.js and 2 other locations - About 1 hr to fix
                rails/app/assets/javascripts/livepipe/window.js on lines 119..124
                rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 123..128

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

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

                Object.extend(Number.prototype, {
                  // Snap a number to a grid
                  snap: function(round) {
                    return parseInt(round == 1 ? this : (this / round).floor() * round);
                  }
                Severity: Major
                Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 1 hr to fix
                rails/app/assets/javascripts/livepipe/window.js on lines 119..124
                rails/public/javascripts/light_box.js on lines 123..128

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

                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

                  register: function(win) {
                    if (this.getWindow(win.id)) return;
                
                    this.handlePosition(win);
                    this.stack.add(win);
                Severity: Major
                Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 1 hr to fix
                rails/app/assets/javascripts/livepipe/window.js on lines 2659..2665
                rails/public/javascripts/light_box.js on lines 4619..4625

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

                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