concord-consortium/rigse

View on GitHub

Showing 2,136 of 2,138 total issues

Function stroke has 156 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  contextPrototype.stroke = function(aFill) {
    var lineStr = [];
    var lineOpen = false;
    var a = processStyle(aFill ? this.fillStyle : this.strokeStyle);
    var color = a.color;
Severity: Major
Found in rails/app/assets/javascripts/flotr/excanvas.js - About 6 hrs to fix

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

      removeOverflow: function() {
        var container = this.container;
        // Remove overflow, save overflow and scrolloffset values to restore them when restore window
        container.savedOverflow = container.style.overflow || "auto";
        container.savedOffset = this.viewport.getScrollOffset();
    Severity: Major
    Found in rails/public/javascripts/light_box.js and 2 other locations - About 6 hrs to fix
    rails/app/assets/javascripts/livepipe/window.js on lines 2803..2814
    rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4769..4780

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

    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

      initialize: function(options) {
        this.setOptions(options);
        this.windowManager = this.options.windowManager || UI.defaultWM;
        this.create();
        this.id = this.element.id;
    Severity: Major
    Found in rails/public/javascripts/light_box.js and 2 other locations - About 6 hrs to fix
    rails/app/assets/javascripts/livepipe/window.js on lines 1397..1406
    rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 3145..3154

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

    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

      initialize: function(options) {
        this.setOptions(options);
        this.windowManager = this.options.windowManager || UI.defaultWM;
        this.create();
        this.id = this.element.id;
    Severity: Major
    Found in rails/app/assets/javascripts/livepipe/window.js and 2 other locations - About 6 hrs to fix
    rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 3145..3154
    rails/public/javascripts/light_box.js on lines 3145..3154

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

    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

      removeOverflow: function() {
        var container = this.container;
        // Remove overflow, save overflow and scrolloffset values to restore them when restore window
        container.savedOverflow = container.style.overflow || "auto";
        container.savedOffset = this.viewport.getScrollOffset();
    Severity: Major
    Found in rails/app/assets/javascripts/livepipe/window.js and 2 other locations - About 6 hrs to fix
    rails/app/assets/javascripts/prototype-ui/prototype-ui.js on lines 4769..4780
    rails/public/javascripts/light_box.js on lines 4769..4780

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

    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

      removeOverflow: function() {
        var container = this.container;
        // Remove overflow, save overflow and scrolloffset values to restore them when restore window
        container.savedOverflow = container.style.overflow || "auto";
        container.savedOffset = this.viewport.getScrollOffset();
    Severity: Major
    Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 6 hrs to fix
    rails/app/assets/javascripts/livepipe/window.js on lines 2803..2814
    rails/public/javascripts/light_box.js on lines 4769..4780

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

    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

      initialize: function(options) {
        this.setOptions(options);
        this.windowManager = this.options.windowManager || UI.defaultWM;
        this.create();
        this.id = this.element.id;
    Severity: Major
    Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js and 2 other locations - About 6 hrs to fix
    rails/app/assets/javascripts/livepipe/window.js on lines 1397..1406
    rails/public/javascripts/light_box.js on lines 3145..3154

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

    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

    Method links_for_material has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
    Open

        def links_for_material( material,
                                skip_lightbox_reloads = false )
          external = false
          if material.is_a? ExternalActivity
            browse_url = browse_external_activity_url(material)
    Severity: Minor
    Found in rails/lib/materials/data_helpers.rb - About 6 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function jshowoff has 150 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        $.fn.jshowoff = function(settings) {
    
            // default global vars
            var config = {
                animatePause : true,
    Severity: Major
    Found in rails/app/assets/javascripts/jshowoff.js - About 6 hrs to fix

      Function findDataRanges has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
      Open

          findDataRanges: function(){
              var s = this.series, 
                  a = this.axes;
              
              a.x.datamin  = a.x.datamax = 
      Severity: Minor
      Found in rails/app/assets/javascripts/flotr/flotr_out.js - About 5 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function findDataRanges has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
      Open

          findDataRanges: function(){
              var s = this.series, 
                  a = this.axes;
              
              a.x.datamin  = a.x.datamax = 
      Severity: Minor
      Found in rails/app/assets/javascripts/flotr/flotr.js - About 5 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

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

        renderRelatedContent () {
          const resource = this.state.resource;
          if (resource.related_materials.length === 0) {
            return null;
          }
      rails/react-components/src/library/components/browse-page/browse-page.tsx on lines 144..162

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

      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

        renderRelatedContent () {
          const resource = this.state.resource;
          if (resource.related_materials.length === 0) {
            return null;
          }
      rails/react-components/src/library/components/resource-lightbox.tsx on lines 289..307

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

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

          getBorderSegments: function( mult ) {
              var el = this.targetElement,
                  bounds, elW, elH,
                  borderInfo = this.styleInfos.borderInfo,
                  segments = [],
      Severity: Major
      Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 5 hrs to fix

        Function Canvas2Image has 147 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var Canvas2Image = (function() {
            // check if we have canvas support
            var oCanvas = document.createElement("canvas"),
                sc = String.fromCharCode,
              strDownloadMime = "image/octet-stream",
        Severity: Major
        Found in rails/app/assets/javascripts/canvas2image.js - About 5 hrs to fix

          Function support has 143 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          jQuery.support = (function() {
          
              var support,
                  all,
                  a,
          Severity: Major
          Found in rails/app/assets/javascripts/jquery/jquery.js - About 5 hrs to fix

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

              renderGradeLevels () {
                const containerClassName = this.state.isSmallScreen ? css.finderOptionsContainer : `${css.finderOptionsContainer} ${css.open}`;
                return (
                  <div className={containerClassName}>
                    <h2 onClick={this.handleFilterHeaderClick}>Grade Level</h2>
            rails/react-components/src/library/components/stem-finder.tsx on lines 497..509

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

            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

              renderSubjectAreas () {
                const containerClassName = this.state.isSmallScreen ? css.finderOptionsContainer : `${css.finderOptionsContainer} ${css.open}`;
                return (
                  <div className={containerClassName}>
                    <h2 onClick={this.handleFilterHeaderClick}>Subject</h2>
            rails/react-components/src/library/components/stem-finder.tsx on lines 511..523

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

            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

            Method up has 142 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def self.up
                create_table :report_learner_activity do |t|
                  t.integer  :learner_id
                  t.integer  :activity_id
                  t.float   :complete_percent
            Severity: Major
            Found in rails/db/migrate/20120712065913_create_report_learner_activity.rb - About 5 hrs to fix

              File itsi-binview-data.ts has 403 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              const itsiMaterials = [
                {
                  category: "Elementary 3-4 Engineering",
                  className: "elementary-34",
                  children: [
              Severity: Minor
              Found in rails/react-components/src/library/helpers/itsi-binview-data.ts - About 5 hrs to fix
                Severity
                Category
                Status
                Source
                Language