concord-consortium/rigse

View on GitHub

Showing 2,136 of 2,138 total issues

Function extendYRangeIfNeededByBar has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

    Function computeSize has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      computeSize: function(width, height, innerSize) {
        var innerWidth, innerHeight, outerWidth, outerHeight;
          if (innerSize) {
            outerWidth  =  width  + this.borderSize.width;
            outerHeight =  height + this.borderSize.height;
    Severity: Minor
    Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 1 hr to fix

      Function computeSize has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        computeSize: function(width, height, innerSize) {
          var innerWidth, innerHeight, outerWidth, outerHeight;
            if (innerSize) {
              outerWidth  =  width  + this.borderSize.width;
              outerHeight =  height + this.borderSize.height;
      Severity: Minor
      Found in rails/app/assets/javascripts/livepipe/window.js - About 1 hr to fix

        Method build_onSearch_message has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def build_onSearch_message(form_model)
            investigations_count = form_model.total_entries['Investigation'] || 0
            activities_count = form_model.total_entries['Activity'] || 0
            interactives_count = form_model.total_entries['Interactive'] || 0
            show_message_onSearch= ""
        Severity: Minor
        Found in rails/app/helpers/search_helper.rb - About 1 hr to fix

          Method search_teachers has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def search_teachers
              authorize Portal::PermissionForm
          
              if params[:name].blank?
                return render json: {
          Severity: Minor
          Found in rails/app/controllers/api/v1/permission_forms_controller.rb - About 1 hr to fix

            Method search has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def search(search, page, user, includes={}, policy_scope=nil)
                sql_parameters = []
                sql_conditions = ""
                # pass in a username to limit the search to the users items
                if (!user.nil?) && (!user.id.nil?)
            Severity: Minor
            Found in rails/lib/searchable_model.rb - About 1 hr to fix

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

                render () {
                  const { type, placeholder, disabled, name } = this.props;
              
                  let className = "text-input " + this.props.name;
                  if (this.props.showRequired && !this.props.isPristine) {
              Severity: Minor
              Found in rails/react-components/src/library/components/signup/text_input.tsx - About 1 hr to fix

                Function toggleFavorite has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  toggleFavorite (e: any) {
                    e.preventDefault();
                    e.stopPropagation();
                
                    if (!Portal.currentUser.isLoggedIn || !Portal.currentUser.isTeacher) {

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

                    destroy: function() {
                      this.windows().invoke('destroy');
                      this.stack.destroy();
                      Event.stopObserving(window, "resize", this.resizeEvent);
                    },
                  Severity: Major
                  Found in rails/public/javascripts/light_box.js and 2 other locations - About 1 hr to fix
                  rails/app/assets/javascripts/livepipe/window.js on lines 2634..2638
                  rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4594..4598

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

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

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

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

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

                  Refactorings

                  Further Reading

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

                    destroy: function() {
                      this.windows().invoke('destroy');
                      this.stack.destroy();
                      Event.stopObserving(window, "resize", this.resizeEvent);
                    },
                  Severity: Major
                  Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 1 hr to fix
                  rails/app/assets/javascripts/livepipe/window.js on lines 2634..2638
                  rails/public/javascripts/light_box.js on lines 4594..4598

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

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

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

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

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

                  Refactorings

                  Further Reading

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

                    destroy: function() {
                      this.windows().invoke('destroy');
                      this.stack.destroy();
                      Event.stopObserving(window, "resize", this.resizeEvent);
                    },
                  Severity: Major
                  Found in rails/app/assets/javascripts/livepipe/window.js and 2 other locations - About 1 hr to fix
                  rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4594..4598
                  rails/public/javascripts/light_box.js on lines 4594..4598

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

                  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

                      $$(".Expand_Collapse_Link").each(function(sharebtn){
                              if (sharebtn.hasClassName('preview_Button'))
                                  {
                                      sharebtn.update("Preview &#9660");
                                  }
                  Severity: Major
                  Found in rails/app/assets/javascripts/share_material.js and 1 other location - About 1 hr to fix
                  rails/app/assets/javascripts/share_material.js on lines 6..13

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

                  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

                          $$(".Expand_Collapse_Link").each(function(sharebtn){
                              if (sharebtn.hasClassName('preview_Button'))
                                  {
                                      sharebtn.update("Preview &#9660");
                                  }
                  Severity: Major
                  Found in rails/app/assets/javascripts/share_material.js and 1 other location - About 1 hr to fix
                  rails/app/assets/javascripts/share_material.js on lines 43..50

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

                  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

                              { data.edit_url != null
                                ? <a className="mb-edit" href={data.edit_url} title="Edit this activity" target="_blank" rel="noopener noreferrer">Edit</a>
                                : undefined }
                  rails/react-components/src/library/components/materials-bin/material.tsx on lines 60..62
                  rails/react-components/src/library/components/materials-bin/material.tsx on lines 66..68
                  rails/react-components/src/library/components/materials-bin/material.tsx on lines 72..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 59.

                  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

                              { data.copy_url != null
                                ? <a className="mb-copy" href={data.copy_url} title="Make your own version of this activity" target="_blank" rel="noopener noreferrer">Copy</a>
                                : undefined }
                  rails/react-components/src/library/components/materials-bin/material.tsx on lines 60..62
                  rails/react-components/src/library/components/materials-bin/material.tsx on lines 63..65
                  rails/react-components/src/library/components/materials-bin/material.tsx on lines 72..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 59.

                  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

                              { data.assign_to_collection_url != null
                                ? <a className="mb-assign-to-collection" href={data.assign_to_collection_url} title="Assign this activity to a collection" target="_blank" rel="noopener noreferrer">Assign to collection</a>
                                : undefined }
                  rails/react-components/src/library/components/materials-bin/material.tsx on lines 60..62
                  rails/react-components/src/library/components/materials-bin/material.tsx on lines 63..65
                  rails/react-components/src/library/components/materials-bin/material.tsx on lines 66..68

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

                  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

                        <div style={{ marginTop: "6px" }}>
                          <div>{ label }</div>
                          <input
                            type="date"
                            name={name}
                  rails/react-components/src/library/components/learner-report-form/index.tsx on lines 312..320

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

                  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

                      if (document.getElementById("pprfl")) {
                        document.getElementById("pprfl")?.removeEventListener("scroll", this.handleLightboxScroll);
                      } else {
                        document.removeEventListener("scroll", this.handlePageScroll);
                      }
                  rails/react-components/src/library/components/stem-finder.tsx on lines 221..225

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

                  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

                            <a href={reportUrl} target="_blank" className={commonCss.smallButton} title="Report" onClick={() => logEvent(reportLogData)} rel="noreferrer">Report</a>
                  rails/react-components/src/library/components/common/offering-buttons.tsx on lines 36..36

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

                  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

                                        <tr className={clsx({ [css.rowWithBackground]: background })}>
                                          <td colSpan={4} className={css.classesTableRow}>
                                            <ClassesTable teacherId={teacher.id} currentSelectedProject={currentSelectedProject} />
                                          </td>
                                        </tr>
                  rails/react-components/src/library/components/permission-forms/students-tab/classes-table.tsx on lines 57..61

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

                  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