concord-consortium/rigse

View on GitHub

Showing 2,136 of 2,138 total issues

Method up has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def self.up
    create_table :biologica_chromosome_zooms do |t|
      
      t.integer   "user_id"
      t.string    "uuid",        :limit => 36

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

      render () {
        return (
          <div className="forgot-password-default-modal-content">
            <Formsy className="forgot-password-form" onValidSubmit={this.submit} role="form" aria-roledescription="form">
    
    

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

        currentDelta: function() {
          return([
            parseInt(Element.getStyle(this.element,'left') || '0'),
            parseInt(Element.getStyle(this.element,'top') || '0')]);
        },
      Severity: Major
      Found in rails/app/assets/javascripts/dragdrop.js and 1 other location - About 1 hr to fix
      rails/app/assets/javascripts/livepipe/resizable.js on lines 134..138

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

      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

        function createButtonPseudo( type ) {
          return function( elem ) {
            var name = elem.nodeName.toLowerCase();
            return (name === "input" || name === "button") && elem.type === type;
          };
      Severity: Major
      Found in rails/app/assets/javascripts/prototype.js and 1 other location - About 1 hr to fix
      rails/app/assets/javascripts/jquery/jquery.js on lines 3961..3966

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

      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

      function createButtonPseudo( type ) {
          return function( elem ) {
              var name = elem.nodeName.toLowerCase();
              return (name === "input" || name === "button") && elem.type === type;
          };
      Severity: Major
      Found in rails/app/assets/javascripts/jquery/jquery.js and 1 other location - About 1 hr to fix
      rails/app/assets/javascripts/prototype.js on lines 4875..4880

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

      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

      Form.Element.Observer = Class.create(Abstract.TimedObserver, {
        getValue: function() {
          return Form.Element.getValue(this.element);
        }
      });
      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 6673..6677

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

      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

      Form.Element.EventObserver = Class.create(Abstract.EventObserver, {
        getValue: function() {
          return Form.Element.getValue(this.element);
        }
      });
      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 6620..6624

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

      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

          currentDelta: function() {
              return([
                  parseInt(Element.getStyle(this.element,'width') || '0'),
                  parseInt(Element.getStyle(this.element,'height') || '0')]);
          },
      Severity: Major
      Found in rails/app/assets/javascripts/livepipe/resizable.js and 1 other location - About 1 hr to fix
      rails/app/assets/javascripts/dragdrop.js on lines 295..299

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

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

        def update
          # PUNDIT_REVIEW_AUTHORIZE
          # PUNDIT_CHECK_AUTHORIZE (did not find instance)
          # authorize @student_clazz
          @portal_student_clazz = Portal::StudentClazz.find(params[:id])
      Severity: Major
      Found in rails/app/controllers/portal/student_clazzes_controller.rb and 6 other locations - About 1 hr to fix
      rails/app/controllers/portal/courses_controller.rb on lines 85..98
      rails/app/controllers/portal/learners_controller.rb on lines 140..153
      rails/app/controllers/portal/nces06_districts_controller.rb on lines 108..121
      rails/app/controllers/portal/nces06_schools_controller.rb on lines 109..122
      rails/app/controllers/portal/school_memberships_controller.rb on lines 83..96
      rails/app/controllers/portal/subjects_controller.rb on lines 81..94

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

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

        def update
          # PUNDIT_REVIEW_AUTHORIZE
          # PUNDIT_CHECK_AUTHORIZE (did not find instance)
          # authorize @learner
          @portal_learner = Portal::Learner.find(params[:id])
      Severity: Major
      Found in rails/app/controllers/portal/learners_controller.rb and 6 other locations - About 1 hr to fix
      rails/app/controllers/portal/courses_controller.rb on lines 85..98
      rails/app/controllers/portal/nces06_districts_controller.rb on lines 108..121
      rails/app/controllers/portal/nces06_schools_controller.rb on lines 109..122
      rails/app/controllers/portal/school_memberships_controller.rb on lines 83..96
      rails/app/controllers/portal/student_clazzes_controller.rb on lines 81..94
      rails/app/controllers/portal/subjects_controller.rb on lines 81..94

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

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

        def update
          @nces06_school = Portal::Nces06School.find(params[:id])
          # PUNDIT_REVIEW_AUTHORIZE
          # PUNDIT_CHECK_AUTHORIZE (found instance)
          # authorize @nces06_school
      Severity: Major
      Found in rails/app/controllers/portal/nces06_schools_controller.rb and 6 other locations - About 1 hr to fix
      rails/app/controllers/portal/courses_controller.rb on lines 85..98
      rails/app/controllers/portal/learners_controller.rb on lines 140..153
      rails/app/controllers/portal/nces06_districts_controller.rb on lines 108..121
      rails/app/controllers/portal/school_memberships_controller.rb on lines 83..96
      rails/app/controllers/portal/student_clazzes_controller.rb on lines 81..94
      rails/app/controllers/portal/subjects_controller.rb on lines 81..94

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

      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 update
          @firebase_app = FirebaseApp.find(params[:id])
          authorize @firebase_app
      
          respond_to do |format|
      Severity: Major
      Found in rails/app/controllers/admin/firebase_apps_controller.rb and 1 other location - About 1 hr to fix
      rails/app/controllers/admin/tools_controller.rb on lines 57..67

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

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

        def update
          @subject = Portal::Subject.find(params[:id])
          # PUNDIT_REVIEW_AUTHORIZE
          # PUNDIT_CHECK_AUTHORIZE (found instance)
          # authorize @subject
      Severity: Major
      Found in rails/app/controllers/portal/subjects_controller.rb and 6 other locations - About 1 hr to fix
      rails/app/controllers/portal/courses_controller.rb on lines 85..98
      rails/app/controllers/portal/learners_controller.rb on lines 140..153
      rails/app/controllers/portal/nces06_districts_controller.rb on lines 108..121
      rails/app/controllers/portal/nces06_schools_controller.rb on lines 109..122
      rails/app/controllers/portal/school_memberships_controller.rb on lines 83..96
      rails/app/controllers/portal/student_clazzes_controller.rb on lines 81..94

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

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

        def update
          @school_membership = Portal::SchoolMembership.find(params[:id])
          # PUNDIT_REVIEW_AUTHORIZE
          # PUNDIT_CHECK_AUTHORIZE (found instance)
          # authorize @school_membership
      rails/app/controllers/portal/courses_controller.rb on lines 85..98
      rails/app/controllers/portal/learners_controller.rb on lines 140..153
      rails/app/controllers/portal/nces06_districts_controller.rb on lines 108..121
      rails/app/controllers/portal/nces06_schools_controller.rb on lines 109..122
      rails/app/controllers/portal/student_clazzes_controller.rb on lines 81..94
      rails/app/controllers/portal/subjects_controller.rb on lines 81..94

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

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

        def update
          @nces06_district = Portal::Nces06District.find(params[:id])
          # PUNDIT_REVIEW_AUTHORIZE
          # PUNDIT_CHECK_AUTHORIZE (found instance)
          # authorize @nces06_district
      rails/app/controllers/portal/courses_controller.rb on lines 85..98
      rails/app/controllers/portal/learners_controller.rb on lines 140..153
      rails/app/controllers/portal/nces06_schools_controller.rb on lines 109..122
      rails/app/controllers/portal/school_memberships_controller.rb on lines 83..96
      rails/app/controllers/portal/student_clazzes_controller.rb on lines 81..94
      rails/app/controllers/portal/subjects_controller.rb on lines 81..94

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

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

        def update
          @course = Portal::Course.find(params[:id])
          # PUNDIT_REVIEW_AUTHORIZE
          # PUNDIT_CHECK_AUTHORIZE (found instance)
          # authorize @course
      Severity: Major
      Found in rails/app/controllers/portal/courses_controller.rb and 6 other locations - About 1 hr to fix
      rails/app/controllers/portal/learners_controller.rb on lines 140..153
      rails/app/controllers/portal/nces06_districts_controller.rb on lines 108..121
      rails/app/controllers/portal/nces06_schools_controller.rb on lines 109..122
      rails/app/controllers/portal/school_memberships_controller.rb on lines 83..96
      rails/app/controllers/portal/student_clazzes_controller.rb on lines 81..94
      rails/app/controllers/portal/subjects_controller.rb on lines 81..94

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

      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 update
          @tool = Tool.find(params[:id])
          authorize @tool
      
          respond_to do |format|
      Severity: Major
      Found in rails/app/controllers/admin/tools_controller.rb and 1 other location - About 1 hr to fix
      rails/app/controllers/admin/firebase_apps_controller.rb on lines 63..73

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

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

        @Authorized()
        @Query(() => [AdminProject])
        async allAdminProjects(@Args() searchParams:ProjectSearch) {
          return await fuzzyFetch<AdminProject>(AdminProject, 'adminProject', searchParams);
        }
      admin-panel/graphql-backend/src/resolvers/PortalPermissionFormResolver.ts on lines 45..49
      admin-panel/graphql-backend/src/resolvers/PortalStudentResolver.ts on lines 46..50
      admin-panel/graphql-backend/src/resolvers/UserResolver.ts on lines 63..67

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

      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

          const handleChange = (evt: any) => {
            this.setState({ [name]: evt.target.checked }, () => {
              this.updateQueryParams();
            });
          };
      rails/react-components/src/library/components/researcher-classes-form/index.tsx on lines 180..184

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

      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

          const handleRemoveCCTeachers = (e: any) => {
            this.setState({ removeCCTeachers: e.target.checked }, () => {
              this.updateFilters();
            });
          };
      rails/react-components/src/library/components/learner-report-form/index.tsx on lines 326..330

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

      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