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

const MBMaterialsByAuthor = createFactory(MBFetchDataHOC(_MBMaterialsByAuthor, () => ({

  dataStateKey: "authors",

  dataUrl: Portal.API_V1.MATERIALS_BIN_UNOFFICIAL_MATERIALS_AUTHORS,
rails/react-components/src/library/components/materials-bin/own-materials.tsx on lines 36..49

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

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

    for (let i = 0; i < standardStatements.length; i++) {
      const statement = standardStatements[i];
      const helper = helpers[statement.type];

      if (helper) {
rails/react-components/src/library/components/resource-lightbox.tsx on lines 246..255

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

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>
                <td><label htmlFor="passwordConfirmation">Password Again</label></td>
                <td><input id="passwordConfirmation" type="password" name="passwordConfirmation" ref={this.passwordConfirmationRef} /></td>
              </tr>
rails/react-components/src/library/components/portal-classes/register-student-modal.tsx on lines 63..66

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

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

        headerItems.push(
          <li key={nextKey("About")} className={"portal-pages-main-nav-item portal-pages-main-nav-about" + (this.props.isAbout ? " current-menu-item" : "")}>
            <a href="/about" className="portal-pages-main-nav-item__link" title="Learn More about the STEM Resource Finder">About</a>
          </li>
        );
rails/react-components/src/library/components/page-header.tsx on lines 170..174
rails/react-components/src/library/components/page-header.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 86.

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

File browse-page.tsx has 272 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from "react";
import Component from "../../helpers/component";
import RelatedResourceResult from "../related-resource-result";
import portalObjectHelpers from "../../helpers/portal-object-helpers";
import { MakeTeacherEditionLink } from "../../helpers/make-teacher-edition-links";

    Function dispatch has 63 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        dispatch: function( event ) {
    
            // Make a writable jQuery.Event from the native event object
            event = jQuery.event.fix( event || window.event );
    
    
    Severity: Major
    Found in rails/app/assets/javascripts/jquery/jquery.js - About 2 hrs to fix

      Function Class has 63 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var Class = (function() {
      
        var IS_DONTENUM_BUGGY = (function(){
          for (var p in { toString: 1 }) {
            if (p === 'toString') return false;
      Severity: Major
      Found in rails/app/assets/javascripts/prototype.js - About 2 hrs to fix

        Function _constructor has 63 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            Lightbox.prototype._constructor = function (options) {
        
                var config = Object.extend({}, Lightbox.defaultOptions);
                Object.extend(config, options);
                this.config = config;
        Severity: Major
        Found in rails/app/assets/javascripts/lightbox.js - About 2 hrs to fix

          Function renderNavLinks has 63 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            renderNavLinks (e: any) {
              const headerItems = [];
              let key = 1;
              const nextKey = (prefix: any) => `navLink_${prefix}_${key++}`;
              if (!this.state.isStudent) {
          Severity: Major
          Found in rails/react-components/src/library/components/page-header.tsx - About 2 hrs to fix

            Calendar has 23 functions (exceeds 20 allowed). Consider refactoring.
            Open

            UI.Calendar = Class.create(UI.Options, {
              options: {
                theme: 'mac_os_x',
                format: '%m/%d/%Y',
                startWeekday: 0,
            Severity: Minor
            Found in rails/public/javascripts/light_box.js - About 2 hrs to fix

              Base has 23 functions (exceeds 20 allowed). Consider refactoring.
              Open

              Autocompleter.Base = Class.create({
                baseInitialize: function(element, update, options) {
                  element          = $(element);
                  this.element     = element;
                  this.update      = $(update);
              Severity: Minor
              Found in rails/app/assets/javascripts/controls.js - About 2 hrs to fix

                Calendar has 23 functions (exceeds 20 allowed). Consider refactoring.
                Open

                UI.Calendar = Class.create(UI.Options, {
                  options: {
                    theme: 'mac_os_x',
                    format: '%m/%d/%Y',
                    startWeekday: 0,
                Severity: Minor
                Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 2 hrs to fix

                  Class Offering has 23 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  class Portal::Offering < ApplicationRecord
                    self.table_name = :portal_offerings
                  
                    acts_as_replicatable
                  
                  
                  Severity: Minor
                  Found in rails/app/models/portal/offering.rb - About 2 hrs to fix

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

                      restartZIndexes: function(){
                        // Reset zIndex
                        var zIndex = this.getZIndex() + 1; // keep a zIndex free for overlay divs
                        this.stack.windows.each(function(w) {
                          w.setZIndex(zIndex);
                    Severity: Major
                    Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 2 hrs to fix
                    rails/app/assets/javascripts/livepipe/window.js on lines 2835..2842
                    rails/public/javascripts/light_box.js on lines 4801..4808

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

                    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

                      restartZIndexes: function(){
                        // Reset zIndex
                        var zIndex = this.getZIndex() + 1; // keep a zIndex free for overlay divs
                        this.stack.windows.each(function(w) {
                          w.setZIndex(zIndex);
                    Severity: Major
                    Found in rails/public/javascripts/light_box.js and 2 other locations - About 2 hrs to fix
                    rails/app/assets/javascripts/livepipe/window.js on lines 2835..2842
                    rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4801..4808

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

                    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

                      restartZIndexes: function(){
                        // Reset zIndex
                        var zIndex = this.getZIndex() + 1; // keep a zIndex free for overlay divs
                        this.stack.windows.each(function(w) {
                          w.setZIndex(zIndex);
                    Severity: Major
                    Found in rails/app/assets/javascripts/livepipe/window.js and 2 other locations - About 2 hrs to fix
                    rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4801..4808
                    rails/public/javascripts/light_box.js on lines 4801..4808

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

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

                        plotLine: function(series, offset){
                            var ctx = this.ctx,
                                xa = series.xaxis,
                                ya = series.yaxis,
                                  tHoz = this.tHoz.bind(this),
                    Severity: Major
                    Found in rails/app/assets/javascripts/flotr/flotr_out.js - About 2 hrs to fix

                      Function plotLine has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          plotLine: function(series, offset){
                              var ctx = this.ctx,
                                  xa = series.xaxis,
                                  ya = series.yaxis,
                                    tHoz = this.tHoz.bind(this),
                      Severity: Major
                      Found in rails/app/assets/javascripts/flotr/flotr.js - About 2 hrs to fix

                        Function setupPlaceholder has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            var setupPlaceholder = function(input, options) {
                                var i, evt, text, styles, zIndex, marginTop, dy, attrNode;
                                var $input = $(input), $placeholder;
                        
                                try {
                        Severity: Major
                        Found in rails/app/assets/javascripts/jquery.placeholder.js - About 2 hrs to fix

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

                              function delayRemoveClass( el, className /*, className2*/ ) {
                                  var classes = dummyArray.slice.call( arguments, 1 ),
                                      i = classes.length;
                                  setTimeout( function() {
                                      if( el ) {
                          Severity: Major
                          Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js and 1 other location - About 2 hrs to fix
                          rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 3953..3963

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

                          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