concord-consortium/rigse

View on GitHub

Showing 2,136 of 2,138 total issues

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

        { links.teacher_guide ? <a className="portal-pages-secondary-button" href={links.teacher_guide.url} target="_blank" onClick={this.handleTeacherGuideClick} rel="noreferrer">{ links.teacher_guide.text }</a> : null }
rails/react-components/src/library/components/browse-page/browse-page.tsx on lines 211..211
rails/react-components/src/library/components/browse-page/browse-page.tsx on lines 212..212
rails/react-components/src/library/components/browse-page/browse-page.tsx on lines 214..214
rails/react-components/src/library/components/resource-lightbox.tsx on lines 395..395

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

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

        { links.teacher_guide ? <a className="portal-pages-secondary-button" href={links.teacher_guide.url} target="_blank" onClick={this.handleTeacherGuideClick} rel="noreferrer">{ links.teacher_guide.text }</a> : null }
rails/react-components/src/library/components/browse-page/browse-page.tsx on lines 211..211
rails/react-components/src/library/components/browse-page/browse-page.tsx on lines 212..212
rails/react-components/src/library/components/resource-lightbox.tsx on lines 395..395
rails/react-components/src/library/components/resource-lightbox.tsx on lines 399..399

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

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

        { links.teacher_resources ? <a className="teacherResourcesLink portal-pages-secondary-button" href={links.teacher_resources.url} target="_blank" onClick={this.handleTeacherResourcesClick} rel="noreferrer">{ links.teacher_resources.text }</a> : null }
rails/react-components/src/library/components/browse-page/browse-page.tsx on lines 211..211
rails/react-components/src/library/components/browse-page/browse-page.tsx on lines 214..214
rails/react-components/src/library/components/resource-lightbox.tsx on lines 395..395
rails/react-components/src/library/components/resource-lightbox.tsx on lines 399..399

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

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

        { links.rubric_doc ? <a className="portal-pages-secondary-button" href={links.rubric_doc.url} target="_blank" onClick={this.handleRubricDocClick} rel="noreferrer">{ links.rubric_doc.text }</a> : null }
rails/react-components/src/library/components/browse-page/browse-page.tsx on lines 211..211
rails/react-components/src/library/components/browse-page/browse-page.tsx on lines 212..212
rails/react-components/src/library/components/browse-page/browse-page.tsx on lines 214..214
rails/react-components/src/library/components/resource-lightbox.tsx on lines 399..399

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

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

@Index("index_portal_nces06_schools_on_NCESSCH", ["ncessch"], {})
@Index("index_portal_nces06_schools_on_SCHNAM", ["schnam"], {})
@Index("index_portal_nces06_schools_on_SEASCH", ["seasch"], {})
@Index("index_portal_nces06_schools_on_STID", ["stid"], {})
@Index(
admin-panel/graphql-backend/src/entities/unused/PortalSchools.ts on lines 3..48

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

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

@Index("index_portal_schools_on_country_id", ["countryId"], {})
@Index("index_portal_schools_on_district_id", ["districtId"], {})
@Index("index_portal_schools_on_nces_school_id", ["ncesSchoolId"], {})
@Index("index_portal_schools_on_state", ["state"], {})
@Index("index_portal_schools_on_name", ["name"], {})
admin-panel/graphql-backend/src/entities/unused/PortalNces06Schools.ts on lines 3..1759

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

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

  function Str(key, holder, stack) {
    var value = holder[key];
    if (Type(value) === OBJECT_TYPE && typeof value.toJSON === 'function') {
      value = value.toJSON(key);
    }
Severity: Minor
Found in rails/app/assets/javascripts/prototype.js - About 1 hr to fix

    Method stats has 49 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def stats
        stats = {}
        stats[:teachers] = Portal::Teacher.count
        stats[:students] = Portal::Student.count
        stats[:classes] = Portal::Clazz.count
    Severity: Minor
    Found in rails/app/controllers/misc_controller.rb - About 1 hr to fix

      Function renderInput has 49 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        renderInput (name: any, titleOverride?: any) {
          if (!this.state.filterables[name]) { return; }
          const agg = this.state.filterables[name];
      
          const isLoading = this.state[`waitingFor_${name}`];

        Function renderResource has 49 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          renderResource () {
            const resource = this.state.resource;
            const links = resource.links;
            const previewLink = links.preview ? <a className="portal-pages-primary-button" href={links.preview.url} target="_blank" onClick={this.handlePreviewClick} rel="noreferrer">{ links.preview.text }</a> : null;
            const prePostTestAvailable = resource.has_pretest ? <p className="portal-pages-resource-lightbox-description">Pre- and Post-tests available</p> : null;

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

                  if(this.options.zindex) {
                      this.originalZ = parseInt(Element.getStyle(this.element,'z-index') || 0);
                      this.element.style.zIndex = this.options.zindex;
                  }
          Severity: Major
          Found in rails/app/assets/javascripts/livepipe/resizable.js and 1 other location - About 1 hr to fix
          rails/app/assets/javascripts/dragdrop.js on lines 328..331

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

          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

            options: {
              container:   null, // will default to document.body
              zIndex:      0,
              theme:       "alphacube",
              shadowTheme: "mac_shadow",
          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 2597..2607
          rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4557..4567

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

          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

            options: {
              container:   null, // will default to document.body
              zIndex:      0,
              theme:       "alphacube",
              shadowTheme: "mac_shadow",
          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 4557..4567
          rails/public/javascripts/light_box.js on lines 4557..4567

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

          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

                'margin-box-height': function(element) {
                  var bHeight = this.get('border-box-height'),
                    mTop = this.get('margin-top'),
                    mBottom = this.get('margin-bottom');
          
          
          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 3859..3867

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

          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

              if(this.options.zindex) {
                this.originalZ = parseInt(Element.getStyle(this.element,'z-index') || 0);
                this.element.style.zIndex = this.options.zindex;
              }
          Severity: Major
          Found in rails/app/assets/javascripts/dragdrop.js and 1 other location - About 1 hr to fix
          rails/app/assets/javascripts/livepipe/resizable.js on lines 160..163

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

          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

                'margin-box-width': function(element) {
                  var bWidth = this.get('border-box-width'),
                    mLeft = this.get('margin-left'),
                    mRight = this.get('margin-right');
          
          
          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 3849..3857

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

          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

            options: {
              container:   null, // will default to document.body
              zIndex:      0,
              theme:       "alphacube",
              shadowTheme: "mac_shadow",
          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 2597..2607
          rails/public/javascripts/light_box.js on lines 4557..4567

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

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

              parseCss: function( css ) {
                  var props,
                      getLength = PIE.getLength,
                      Type = PIE.Tokenizer.Type,
                      tokenizer;
          Severity: Minor
          Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 hr to fix

            Function remove has 48 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                remove: function( elem, types, handler, selector, mappedTypes ) {
            
                    var t, tns, type, origType, namespaces, origCount,
                        j, events, special, eventType, handleObj,
                        elemData = jQuery.hasData( elem ) && jQuery._data( elem );
            Severity: Minor
            Found in rails/app/assets/javascripts/jquery/jquery.js - About 1 hr to fix

              Function data has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  data: function( key, value ) {
                      var parts, part, attr, name, l,
                          elem = this[0],
                          i = 0,
                          data = null;
              Severity: Minor
              Found in rails/app/assets/javascripts/jquery/jquery.js - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language