concord-consortium/rigse

View on GitHub

Showing 2,136 of 2,138 total issues

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

  def create
    authorize FirebaseApp
    @firebase_app = FirebaseApp.new(firebase_app_strong_params(params[: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 41..51

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

  def create
    # PUNDIT_REVIEW_AUTHORIZE
    # PUNDIT_CHECK_AUTHORIZE
    # authorize Portal::SchoolMembership
    @school_membership = Portal::SchoolMembership.new(portal_school_membership_strong_params(params[:school_membership]))
rails/app/controllers/portal/courses_controller.rb on lines 65..78
rails/app/controllers/portal/learners_controller.rb on lines 120..133
rails/app/controllers/portal/nces06_districts_controller.rb on lines 88..101
rails/app/controllers/portal/nces06_schools_controller.rb on lines 89..102
rails/app/controllers/portal/student_clazzes_controller.rb on lines 61..74
rails/app/controllers/portal/subjects_controller.rb on lines 61..74

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

  def create
    # PUNDIT_REVIEW_AUTHORIZE
    # PUNDIT_CHECK_AUTHORIZE
    # authorize Portal::Course
    @course = Portal::Course.new(portal_course_strong_params(params[:portal_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 120..133
rails/app/controllers/portal/nces06_districts_controller.rb on lines 88..101
rails/app/controllers/portal/nces06_schools_controller.rb on lines 89..102
rails/app/controllers/portal/school_memberships_controller.rb on lines 63..76
rails/app/controllers/portal/student_clazzes_controller.rb on lines 61..74
rails/app/controllers/portal/subjects_controller.rb on lines 61..74

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

  def create
    # PUNDIT_REVIEW_AUTHORIZE
    # PUNDIT_CHECK_AUTHORIZE
    # authorize Portal::StudentClazz
    @portal_student_clazz = Portal::StudentClazz.new(portal_student_clazz_strong_params(params[:portal_student_clazz]))
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 65..78
rails/app/controllers/portal/learners_controller.rb on lines 120..133
rails/app/controllers/portal/nces06_districts_controller.rb on lines 88..101
rails/app/controllers/portal/nces06_schools_controller.rb on lines 89..102
rails/app/controllers/portal/school_memberships_controller.rb on lines 63..76
rails/app/controllers/portal/subjects_controller.rb on lines 61..74

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

  def create
    # PUNDIT_REVIEW_AUTHORIZE
    # PUNDIT_CHECK_AUTHORIZE
    # authorize Portal::Nces06School
    @nces06_school = Portal::Nces06School.new(portal_nces06_school_strong_params(params[: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 65..78
rails/app/controllers/portal/learners_controller.rb on lines 120..133
rails/app/controllers/portal/nces06_districts_controller.rb on lines 88..101
rails/app/controllers/portal/school_memberships_controller.rb on lines 63..76
rails/app/controllers/portal/student_clazzes_controller.rb on lines 61..74
rails/app/controllers/portal/subjects_controller.rb on lines 61..74

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

  def create
    # PUNDIT_REVIEW_AUTHORIZE
    # PUNDIT_CHECK_AUTHORIZE
    # authorize Portal::Subject
    @subject = Portal::Subject.new(portal_subject_strong_params(params[: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 65..78
rails/app/controllers/portal/learners_controller.rb on lines 120..133
rails/app/controllers/portal/nces06_districts_controller.rb on lines 88..101
rails/app/controllers/portal/nces06_schools_controller.rb on lines 89..102
rails/app/controllers/portal/school_memberships_controller.rb on lines 63..76
rails/app/controllers/portal/student_clazzes_controller.rb on lines 61..74

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

  def create
    # PUNDIT_REVIEW_AUTHORIZE
    # PUNDIT_CHECK_AUTHORIZE
    # authorize Portal::Learner
    @portal_learner = Portal::Learner.new(portal_learner_strong_params(params[:learner]))
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 65..78
rails/app/controllers/portal/nces06_districts_controller.rb on lines 88..101
rails/app/controllers/portal/nces06_schools_controller.rb on lines 89..102
rails/app/controllers/portal/school_memberships_controller.rb on lines 63..76
rails/app/controllers/portal/student_clazzes_controller.rb on lines 61..74
rails/app/controllers/portal/subjects_controller.rb on lines 61..74

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 create
    authorize Tool
    @tool = Tool.new(tool_strong_params(params[: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 46..56

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

  def create
    # PUNDIT_REVIEW_AUTHORIZE
    # PUNDIT_CHECK_AUTHORIZE
    # authorize Portal::Nces06District
    @nces06_district = Portal::Nces06District.new(portal_nces06_district_strong_params(params[:nces06_district]))
rails/app/controllers/portal/courses_controller.rb on lines 65..78
rails/app/controllers/portal/learners_controller.rb on lines 120..133
rails/app/controllers/portal/nces06_schools_controller.rb on lines 89..102
rails/app/controllers/portal/school_memberships_controller.rb on lines 63..76
rails/app/controllers/portal/student_clazzes_controller.rb on lines 61..74
rails/app/controllers/portal/subjects_controller.rb on lines 61..74

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

    const handleSelectChange = (value: any) => {
      this.setState({ [name]: value }, () => {
        this.updateFilters();
        this.updateQueryParams();
      });
rails/react-components/src/library/components/learner-report-form/index.tsx on lines 264..269

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

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

  constructor (props: any) {
    super(props);
    this.state = {
      updating: false
    };
rails/react-components/src/library/components/materials-bin/user-materials.tsx on lines 6..12
rails/react-components/src/library/components/recent-activity/offering.tsx on lines 8..14

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

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

  constructor (props: any) {
    super(props);
    this.state = {
      detailsVisible: false
    };
rails/react-components/src/library/components/materials-bin/user-materials.tsx on lines 6..12
rails/react-components/src/library/components/standards/standards-row.tsx on lines 5..11

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

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

    const handleSelectChange = (value: any) => {
      this.setState({ [name]: value }, () => {
        this.updateFilters();
        this.updateQueryParams();
      });
rails/react-components/src/library/components/user-report-form/index.tsx on lines 164..169

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

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

  constructor (props: any) {
    super(props);
    this.state = {
      materialsVisible: false
    };
rails/react-components/src/library/components/recent-activity/offering.tsx on lines 8..14
rails/react-components/src/library/components/standards/standards-row.tsx on lines 5..11

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

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

function validateJSON(event) {
  if (!event.body) {
    throw new Error("Missing post body in request")
  }

Severity: Minor
Found in external-report-demo/report-demo/app.js - About 1 hr to fix

    Function registerValidSW has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function registerValidSW(swUrl, config) {
      navigator.serviceWorker
        .register(swUrl)
        .then(registration => {
          registration.onupdatefound = () => {
    Severity: Minor
    Found in admin-panel/react-admin-interface/src/serviceWorker.js - About 1 hr to fix

      Function withActualBg has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          withActualBg: function( fn ) {
              var isIE9 = PIE.ieDocMode > 8,
                  propNames = this.propertyNames,
                  rs = this.targetElement.runtimeStyle,
                  rsImage = rs[propNames.IMAGE],
      Severity: Minor
      Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 hr to fix

        Function cloneFixAttributes has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function cloneFixAttributes( src, dest ) {
            var nodeName;
        
            // We do not need to do anything for non-Elements
            if ( dest.nodeType !== 1 ) {
        Severity: Minor
        Found in rails/app/assets/javascripts/jquery/jquery.js - About 1 hr to fix

          Function style has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              style: function( elem, name, value, extra ) {
                  // Don't set styles on text and comment nodes
                  if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
                      return;
                  }
          Severity: Minor
          Found in rails/app/assets/javascripts/jquery/jquery.js - About 1 hr to fix

            Function calculateTicks has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                calculateTicks: function(axis){
                    var o = axis.options, i, v;
                    
                    axis.ticks = [];    
                    if(o.ticks){
            Severity: Minor
            Found in rails/app/assets/javascripts/flotr/flotr_out.js - About 1 hr to fix
              Severity
              Category
              Status
              Source
              Language