concord-consortium/rigse

View on GitHub

Showing 2,136 of 2,138 total issues

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

  constructor (props: any) {
    super(props);
    this.toggle = this.toggle.bind(this);
    this.toggleFromChild = this.toggleFromChild.bind(this);
  }
rails/react-components/src/library/components/portal-classes/student-roster-row.tsx on lines 6..10
rails/react-components/src/library/components/signup/forgot_password_modal.tsx on lines 10..15
rails/react-components/src/library/components/signup/user_type_selector.tsx on lines 4..8

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

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

  constructor (props: any) {
    super(props);

    this.submit = this.submit.bind(this);
    this.handleShowSignup = this.handleShowSignup.bind(this);
rails/react-components/src/library/components/portal-classes/student-roster-row.tsx on lines 6..10
rails/react-components/src/library/components/search/material-details.tsx on lines 4..8
rails/react-components/src/library/components/signup/user_type_selector.tsx on lines 4..8

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

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

      {
        showCreateNewFormModal &&
        <ModalDialog borderColor="orange">
          <CreateEditPermissionForm
            currentSelectedProject={currentSelectedProject}
rails/react-components/src/library/components/permission-forms/manage-forms-tab/manage-forms-tab.tsx on lines 134..144

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

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

      {
        editForm &&
        <ModalDialog borderColor="orange">
          <CreateEditPermissionForm
            existingFormData={editForm}
rails/react-components/src/library/components/permission-forms/manage-forms-tab/manage-forms-tab.tsx on lines 123..133

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

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 handleProjectSelectChange = (e: React.ChangeEvent<HTMLSelectElement>) => {
    setCurrentSelectedProject(e.target.value === "" ? null : Number(e.target.value));
  };
rails/react-components/src/library/components/permission-forms/students-tab/students-tab.tsx on lines 37..39

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

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

  constructor (props: any) {
    super(props);
    this.handleRemoveStudent = this.handleRemoveStudent.bind(this);
    this.handleChangePassword = this.handleChangePassword.bind(this);
  }
rails/react-components/src/library/components/search/material-details.tsx on lines 4..8
rails/react-components/src/library/components/signup/forgot_password_modal.tsx on lines 10..15
rails/react-components/src/library/components/signup/user_type_selector.tsx on lines 4..8

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

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

  constructor (props: any) {
    super(props);
    this.handleClick = this.handleClick.bind(this);
    this.handleLoginClick = this.handleLoginClick.bind(this);
  }
rails/react-components/src/library/components/portal-classes/student-roster-row.tsx on lines 6..10
rails/react-components/src/library/components/search/material-details.tsx on lines 4..8
rails/react-components/src/library/components/signup/forgot_password_modal.tsx on lines 10..15

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

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

  strftime: function(grammar) {
    var parts = { }, i18n = Date.default_i18n;
    var lambda = function(date, part) {
      switch (part) {
      // date
Severity: Minor
Found in rails/public/javascripts/light_box.js - About 1 hr to fix

    Function getBoxPath has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        getBoxPath: function( shrink, mult, radii ) {
            mult = mult || 1;
    
            var r, str,
                bounds = this.boundsInfo.getBounds(),
    Severity: Minor
    Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 hr to fix

      Function updatePos has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          updatePos: function() {
              if( this.isActive() ) {
                  var el = this.getPositioningElement(),
                      par = el,
                      docEl,
      Severity: Minor
      Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 hr to fix

        Function strftime has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          strftime: function(grammar) {
            var parts = { }, i18n = Date.default_i18n;
            var lambda = function(date, part) {
              switch (part) {
              // date
        Severity: Minor
        Found in rails/public/javascripts/light_box.js - About 1 hr to fix

          Function load has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          jQuery.fn.load = function( url, params, callback ) {
              if ( typeof url !== "string" && _load ) {
                  return _load.apply( this, arguments );
              }
          
          
          Severity: Minor
          Found in rails/app/assets/javascripts/jquery/jquery.js - About 1 hr to fix

            Function strftime has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              strftime: function(grammar) {
                var parts = { }, i18n = Date.default_i18n;
                var lambda = function(date, part) {
                  switch (part) {
                  // date
            Severity: Minor
            Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 1 hr to fix

              Function strftime has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                strftime: function(grammar) {
                  var parts = { }, i18n = Date.default_i18n;
                  var lambda = function(date, part) {
                    switch (part) {
                    // date
              Severity: Minor
              Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 1 hr to fix

                Method grep_files has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                def grep_files(directory, blocks, new_blocks)
                  original_dir = Dir.pwd
                  if(directory == "lib")
                    Dir.chdir "../lib"
                    glob = '**/*.rb'
                Severity: Minor
                Found in rails/script/reference-tree.rb - About 1 hr to fix

                  Method create has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def create
                      teacher_registration = API::V1::TeacherRegistration.new(teacher_registration_strong_params(params))
                  
                      # This was added to allow for registering after logging in the first time with SSO
                      # But it also occurs if a user is able to access the registration form while being
                  Severity: Minor
                  Found in rails/app/controllers/api/v1/teachers_controller.rb - About 1 hr to fix

                    Method student_roster_props has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def student_roster_props(portal_clazz=@portal_clazz)
                    
                        can_edit = portal_clazz.changeable?(current_visitor)
                    
                        students = []
                    Severity: Minor
                    Found in rails/app/helpers/portal/clazzes_helper.rb - About 1 hr to fix

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

                        render () {
                          let buttonText;
                          const { updating } = this.state;
                          const { statement } = this.props;
                      
                      

                        Function renderGLLogo has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          renderGLLogo (gradeLevel: any) {
                            let className = "portal-pages-finder-form-filters-logo";
                            const filterId = this.buildFilterId(gradeLevel.key);
                        
                            const selected = this.state.gradeLevelsSelectedMap[gradeLevel.key];
                        Severity: Minor
                        Found in rails/react-components/src/library/components/stem-finder.tsx - About 1 hr to fix

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

                                'border-box-height': function(element) {
                                  if (!this._preComputing) this._begin();
                                  var height = element.offsetHeight;
                                  if (!this._preComputing) this._end();
                                  return height;
                          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 3842..3847

                          Duplicated Code

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

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

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

                          Tuning

                          This issue has a mass of 65.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Severity
                          Category
                          Status
                          Source
                          Language