sleepepi/sleepportal

View on GitHub

Showing 436 of 436 total issues

Function justifyDataLabel has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    justifyDataLabel: function (dataLabel, options, alignAttr, bBox, alignTo, isNew) {
        var chart = this.chart,
            align = options.align,
            verticalAlign = options.verticalAlign,
            off,
Severity: Minor
Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

    Function run_search has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function run_search(query) {
            var cached_results = cache.get(query);
            if(cached_results) {
                populate_dropdown(query, cached_results);
            } else {
    Severity: Minor
    Found in app/assets/javascripts/external/jquery.tokeninput.js - About 1 hr to fix

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

      function arrayMin(data) {
          var i = data.length,
              min = data[0];
      
          while (i--) {
      Severity: Major
      Found in app/assets/javascripts/external/highcharts-3.0.7.src.js and 1 other location - About 1 hr to fix
      app/assets/javascripts/external/highcharts-3.0.7.src.js on lines 895..905

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

      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

              getRegion: function (el, x, y) {
                  var shapeid = this.target.getShapeAt(el, x, y);
                  return (shapeid !== undefined && this.shapes[shapeid] !== undefined) ? this.shapes[shapeid] : undefined;
              },
      Severity: Major
      Found in app/assets/javascripts/external/jquery.sparkline.js and 1 other location - About 1 hr to fix
      app/assets/javascripts/external/jquery.sparkline.js on lines 2259..2262

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

      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

      function arrayMax(data) {
          var i = data.length,
              max = data[0];
      
          while (i--) {
      Severity: Major
      Found in app/assets/javascripts/external/highcharts-3.0.7.src.js and 1 other location - About 1 hr to fix
      app/assets/javascripts/external/highcharts-3.0.7.src.js on lines 878..888

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

      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

              getRegion: function (el, x, y) {
                  var shapeid = this.target.getShapeAt(el, x, y);
                  return (shapeid !== undefined && this.shapes[shapeid] !== undefined) ? this.shapes[shapeid] : undefined;
              },
      Severity: Major
      Found in app/assets/javascripts/external/jquery.sparkline.js and 1 other location - About 1 hr to fix
      app/assets/javascripts/external/jquery.sparkline.js on lines 2136..2139

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

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

              rect: function (left, top, width, height, options) {
      
                  var right = left + width,
                      bottom = top + height,
                      ret,
      Severity: Minor
      Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

        Function init has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            init: function (chart, options) {
                var series = this,
                    eventType,
                    events,
                    chartSeries = chart.series;
        Severity: Minor
        Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

          Function drawPoints has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              drawPoints: function () {
                  var series = this,
                      chart = series.chart,
                      renderer = chart.renderer,
                      groupTranslation,
          Severity: Minor
          Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

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

                        if (options.get('chartRangeMinX') !== undefined && (options.get('chartRangeClipX') || options.get('chartRangeMinX') < this.minx)) {
                            this.minx = options.get('chartRangeMinX');
                        }
            Severity: Major
            Found in app/assets/javascripts/external/jquery.sparkline.js and 5 other locations - About 1 hr to fix
            app/assets/javascripts/external/jquery.sparkline.js on lines 1468..1470
            app/assets/javascripts/external/jquery.sparkline.js on lines 1471..1473
            app/assets/javascripts/external/jquery.sparkline.js on lines 1477..1479
            app/assets/javascripts/external/jquery.sparkline.js on lines 2050..2052
            app/assets/javascripts/external/jquery.sparkline.js on lines 2053..2055

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

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

                        if (options.get('chartRangeMin') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMin') < this.min)) {
                            this.min = options.get('chartRangeMin');
                        }
            Severity: Major
            Found in app/assets/javascripts/external/jquery.sparkline.js and 5 other locations - About 1 hr to fix
            app/assets/javascripts/external/jquery.sparkline.js on lines 1468..1470
            app/assets/javascripts/external/jquery.sparkline.js on lines 1471..1473
            app/assets/javascripts/external/jquery.sparkline.js on lines 1474..1476
            app/assets/javascripts/external/jquery.sparkline.js on lines 1477..1479
            app/assets/javascripts/external/jquery.sparkline.js on lines 2053..2055

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

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

                        if (options.get('chartRangeMin') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMin') < this.miny)) {
                            this.miny = options.get('chartRangeMin');
                        }
            Severity: Major
            Found in app/assets/javascripts/external/jquery.sparkline.js and 5 other locations - About 1 hr to fix
            app/assets/javascripts/external/jquery.sparkline.js on lines 1471..1473
            app/assets/javascripts/external/jquery.sparkline.js on lines 1474..1476
            app/assets/javascripts/external/jquery.sparkline.js on lines 1477..1479
            app/assets/javascripts/external/jquery.sparkline.js on lines 2050..2052
            app/assets/javascripts/external/jquery.sparkline.js on lines 2053..2055

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

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

                        if (options.get('chartRangeMax') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMax') > this.max)) {
                            this.max = options.get('chartRangeMax');
                        }
            Severity: Major
            Found in app/assets/javascripts/external/jquery.sparkline.js and 5 other locations - About 1 hr to fix
            app/assets/javascripts/external/jquery.sparkline.js on lines 1468..1470
            app/assets/javascripts/external/jquery.sparkline.js on lines 1471..1473
            app/assets/javascripts/external/jquery.sparkline.js on lines 1474..1476
            app/assets/javascripts/external/jquery.sparkline.js on lines 1477..1479
            app/assets/javascripts/external/jquery.sparkline.js on lines 2050..2052

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

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

                        if (options.get('chartRangeMax') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMax') > this.maxy)) {
                            this.maxy = options.get('chartRangeMax');
                        }
            Severity: Major
            Found in app/assets/javascripts/external/jquery.sparkline.js and 5 other locations - About 1 hr to fix
            app/assets/javascripts/external/jquery.sparkline.js on lines 1468..1470
            app/assets/javascripts/external/jquery.sparkline.js on lines 1474..1476
            app/assets/javascripts/external/jquery.sparkline.js on lines 1477..1479
            app/assets/javascripts/external/jquery.sparkline.js on lines 2050..2052
            app/assets/javascripts/external/jquery.sparkline.js on lines 2053..2055

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

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

                        if (options.get('chartRangeMaxX') !== undefined && (options.get('chartRangeClipX') || options.get('chartRangeMaxX') > this.maxx)) {
                            this.maxx = options.get('chartRangeMaxX');
                        }
            Severity: Major
            Found in app/assets/javascripts/external/jquery.sparkline.js and 5 other locations - About 1 hr to fix
            app/assets/javascripts/external/jquery.sparkline.js on lines 1468..1470
            app/assets/javascripts/external/jquery.sparkline.js on lines 1471..1473
            app/assets/javascripts/external/jquery.sparkline.js on lines 1474..1476
            app/assets/javascripts/external/jquery.sparkline.js on lines 2050..2052
            app/assets/javascripts/external/jquery.sparkline.js on lines 2053..2055

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

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

                getSeriesExtremes: function () {
                    var axis = this,
                        chart = axis.chart;
            
                    axis.hasVisibleSeries = false;
            Severity: Minor
            Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

              Function init has 43 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  init: function (container, width, height, forExport) {
                      var renderer = this,
                          loc = location,
                          boxWrapper,
                          element,
              Severity: Minor
              Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

                Function drawTracker has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    drawTracker: function () {
                        var series = this,
                            chart = series.chart,
                            pointer = chart.pointer,
                            cursor = series.options.cursor,
                Severity: Minor
                Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                                  if (fillType === 'gradient') {
                                      x1 = gradient.x1 || gradient[0] || 0;
                                      y1 = gradient.y1 || gradient[1] || 0;
                                      x2 = gradient.x2 || gradient[2] || 0;
                                      y2 = gradient.y2 || gradient[3] || 0;
                  Severity: Critical
                  Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

                    Function align has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        align: function (alignOptions, alignByTranslate, box) {
                            var align,
                                vAlign,
                                x,
                                y,
                    Severity: Minor
                    Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language