concord-consortium/rigse

View on GitHub

Showing 2,136 of 2,138 total issues

Consider simplifying this complex logical expression.
Open

if ( jQuery.expr && jQuery.expr.filters ) {
    jQuery.expr.filters.hidden = function( elem ) {
        return ( elem.offsetWidth === 0 && elem.offsetHeight === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || curCSS( elem, "display" )) === "none");
    };

Severity: Major
Found in rails/app/assets/javascripts/jquery/jquery.js - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

                    if ( unit !== "px" && start ) {
                        // Iteratively approximate from a nonzero starting point
                        // Prefer the current property, because this process will be trivial if it uses the same units
                        // Fallback to end or a simple constant
                        start = jQuery.css( tween.elem, prop, true ) || end || 1;
    Severity: Major
    Found in rails/app/assets/javascripts/jquery/jquery.js - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

                      if(((!s.bars.show) && xdiff < xsens && ydiff < ysens) || 
                          (s.bars.show && xdiff < s.bars.barWidth/2 && my > ya.min && my < y)){
                          var distance = Math.sqrt(xdiff*xdiff + ydiff*ydiff);
                          if(distance < n.dist){
                              n.dist = distance;
      Severity: Major
      Found in rails/app/assets/javascripts/flotr/flotr_out.js - About 1 hr to fix

        Consider simplifying this complex logical expression.
        Open

                        if(((!s.bars.show) && xdiff < xsens && ydiff < ysens) || 
                            (s.bars.show && xdiff < s.bars.barWidth/2 && my > ya.min && my < y)){
                            var distance = Math.sqrt(xdiff*xdiff + ydiff*ydiff);
                            if(distance < n.dist){
                                n.dist = distance;
        Severity: Major
        Found in rails/app/assets/javascripts/flotr/flotr.js - About 1 hr to fix

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

                if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
                  this.form_field.fire("chosen:maxselected", {
                    chosen: this
                  });
                  return false;
          Severity: Major
          Found in rails/app/assets/javascripts/chosen.proto.js and 1 other location - About 1 hr to fix
          rails/app/assets/javascripts/chosen.proto.js on lines 1055..1060

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

          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 (this.is_multiple && this.max_selected_options <= this.choices_count()) {
                    this.form_field.fire("chosen:maxselected", {
                      chosen: this
                    });
                    return false;
          Severity: Major
          Found in rails/app/assets/javascripts/chosen.proto.js and 1 other location - About 1 hr to fix
          rails/app/assets/javascripts/chosen.proto.js on lines 893..898

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

          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
              @@all_table_pairs.each do |table_pair|
                rename_table table_pair[1], table_pair[0]
              end
              @@all_model_classname_pairs.each do |model_pair|
          Severity: Minor
          Found in rails/db/migrate/20100121032411_embeddable_refactoring.rb and 1 other location - About 1 hr to fix
          rails/db/migrate/20100121032411_embeddable_refactoring.rb on lines 85..91

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

          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

              respond_to do |format|
                if @interactive.save
                  format.js  # render the js file
                  flash['notice'] = 'Interactive was successfully created.'
                  format.html { redirect_to(@interactive) }
          Severity: Minor
          Found in rails/app/controllers/interactives_controller.rb and 1 other location - About 1 hr to fix
          rails/app/controllers/external_activities_controller.rb on lines 124..132

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

          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

            create_table "portal_student_permission_forms", id: :integer, charset: "utf8", force: :cascade do |t|
              t.boolean "signed"
              t.integer "portal_student_id"
              t.integer "portal_permission_form_id"
              t.datetime "created_at", null: false
          Severity: Minor
          Found in rails/db/schema.rb and 1 other location - About 1 hr to fix
          rails/db/schema.rb on lines 140..148

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

          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

              respond_to do |format|
                if @external_activity.save
                  format.js  # render the js file
                  flash['notice'] = 'ExternalActivity was successfully created.'
                  format.html { redirect_to(@external_activity) }
          Severity: Minor
          Found in rails/app/controllers/external_activities_controller.rb and 1 other location - About 1 hr to fix
          rails/app/controllers/interactives_controller.rb on lines 92..100

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

          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
              @@all_table_pairs.each do |table_pair|
                rename_table table_pair[0], table_pair[1]
              end
              @@all_model_classname_pairs.each do |model_pair|
          Severity: Minor
          Found in rails/db/migrate/20100121032411_embeddable_refactoring.rb and 1 other location - About 1 hr to fix
          rails/db/migrate/20100121032411_embeddable_refactoring.rb on lines 95..101

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

          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

            create_table "admin_site_notice_users", id: :integer, charset: "utf8", force: :cascade do |t|
              t.integer "notice_id"
              t.integer "user_id"
              t.boolean "notice_dismissed"
              t.datetime "created_at", null: false
          Severity: Minor
          Found in rails/db/schema.rb and 1 other location - About 1 hr to fix
          rails/db/schema.rb on lines 1334..1342

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

          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 (!value || value === 'auto') {
                var css = document.defaultView.getComputedStyle(element, null);
                value = css ? css[style] : null;
              }
          Severity: Minor
          Found in rails/app/assets/javascripts/prototype.js and 1 other location - About 55 mins to fix
          rails/app/assets/javascripts/prototype.js on lines 3092..3095

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

          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 (!value || value === 'auto') {
                var css = document.defaultView.getComputedStyle(element, null);
                value = css ? css[style] : null;
              }
          Severity: Minor
          Found in rails/app/assets/javascripts/prototype.js and 1 other location - About 55 mins to fix
          rails/app/assets/javascripts/prototype.js on lines 3496..3499

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

          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

                "even": createPositionalPseudo(function( matchIndexes, length ) {
                  var i = 0;
                  for ( ; i < length; i += 2 ) {
                    matchIndexes.push( i );
                  }
          Severity: Minor
          Found in rails/app/assets/javascripts/prototype.js and 1 other location - About 55 mins to fix
          rails/app/assets/javascripts/prototype.js on lines 5707..5713

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

          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

                "odd": createPositionalPseudo(function( matchIndexes, length ) {
                  var i = 1;
                  for ( ; i < length; i += 2 ) {
                    matchIndexes.push( i );
                  }
          Severity: Minor
          Found in rails/app/assets/javascripts/prototype.js and 1 other location - About 55 mins to fix
          rails/app/assets/javascripts/prototype.js on lines 5699..5705

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

          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

            handleAddToCollectionClick (e: any) {
              const { resource } = this.props;
              gtag("event", "click", {
                "category": "Add to Collection Button",
                "resource": resource.name
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 172..178
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 180..186
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 188..194
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 196..202
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 204..210
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 212..218
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 220..226

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

          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

            handleTeacherGuideClick (e: any) {
              const { resource } = this.props;
              gtag("event", "click", {
                "category": "Teacher Guide Link",
                "resource": resource.name
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 172..178
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 180..186
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 188..194
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 196..202
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 204..210
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 212..218
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 228..234

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

          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

            handleRubricDocClick (e: any) {
              const { resource } = this.props;
              gtag("event", "click", {
                "category": "Resource Rubric Doc Button",
                "resource": resource.name
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 172..178
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 180..186
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 188..194
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 196..202
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 212..218
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 220..226
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 228..234

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

          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

            handlePreviewClick (e: any) {
              const { resource } = this.props;
              gtag("event", "click", {
                "category": "Resource Preview Button",
                "resource": resource.name
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 180..186
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 188..194
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 196..202
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 204..210
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 212..218
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 220..226
          rails/react-components/src/library/components/stem-finder-result.tsx on lines 228..234

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

          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