sleepepi/sleepportal

View on GitHub

Showing 436 of 436 total issues

File highcharts-3.0.7.src.js has 11199 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// ==ClosureCompiler==
// @compilation_level SIMPLE_OPTIMIZATIONS

/**
 * @license Highcharts JS v3.0.7 (2013-10-24)
Severity: Major
Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 mo to fix

    File jquery.sparkline.js has 2441 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
    *
    * jquery.sparkline.js
    *
    * v2.1.1
    Severity: Major
    Found in app/assets/javascripts/external/jquery.sparkline.js - About 6 days to fix

      File select2.js has 1712 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*
       Copyright 2012 Igor Vaynberg
      
       Version: 3.2 Timestamp: Mon Sep 10 10:38:04 PDT 2012
      
      
      Severity: Major
      Found in app/assets/javascripts/external/select2.js - About 4 days to fix

        Method finalize_report_table has a Cognitive Complexity of 153 (exceeds 5 allowed). Consider refactoring.
        Open

          def finalize_report_table(current_user, include_html = true)
        
            result_hash = self.generate_report_table(current_user)
        
            values = result_hash[:values]
        Severity: Minor
        Found in app/models/report.rb - About 3 days 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 TokenList has 480 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        $.TokenList = function (input, url_or_data, settings) {
            //
            // Initialization
            //
        
        
        Severity: Major
        Found in app/assets/javascripts/external/jquery.tokeninput.js - About 2 days to fix

          File jquery.tokeninput.js has 590 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*
           * jQuery Plugin: Tokenizing Autocomplete Text Entry
           * Version 1.5.0
           *
           * Copyright (c) 2009 James Smith (http://loopj.com)
          Severity: Major
          Found in app/assets/javascripts/external/jquery.tokeninput.js - About 1 day to fix

            Method generate_report_table has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
            Open

              def generate_report_table(current_user)
                filtered_report_concepts = self.report_concepts.select{|rc| not rc.position.blank?}
                values = self.search.view_concept_values(current_user, filtered_report_concepts)
            
                row_values = []
            Severity: Minor
            Found in app/models/report.rb - About 1 day 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 drawDataLabels has 201 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                drawDataLabels: function () {
                    var series = this,
                        data = series.data,
                        point,
                        chart = series.chart,
            Severity: Major
            Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 day to fix

              Function label has 198 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  label: function (str, x, y, shape, anchorX, anchorY, useHTML, baseline, className) {
              
                      var renderer = this,
                          wrapper = renderer.g(className),
                          text = renderer.text('', 0, 0, useHTML)
              Severity: Major
              Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 7 hrs to fix

                Function attr has 164 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    attr: function (hash, val) {
                        var wrapper = this,
                            key,
                            value,
                            result,
                Severity: Major
                Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 6 hrs to fix

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

                          render: function () {
                              var options = this.options,
                                  target = this.target,
                                  canvasWidth = this.canvasWidth,
                                  canvasHeight = this.canvasHeight,
                  Severity: Major
                  Found in app/assets/javascripts/external/jquery.sparkline.js - About 6 hrs to fix

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

                        render: function () {
                            var axis = this,
                                chart = axis.chart,
                                renderer = chart.renderer,
                                options = axis.options,
                    Severity: Major
                    Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 6 hrs to fix

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

                          def generate_sql_as_normal(thesource)
                            result = "1 = 0"
                      
                            result_hash = thesource.sql_codes(current_user)
                            sql_text = result_hash[:text]
                      Severity: Minor
                      Found in app/models/resolver.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 setTickPositions has 149 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          setTickPositions: function (secondPass) {
                              var axis = this,
                                  chart = axis.chart,
                                  options = axis.options,
                                  isLog = axis.isLog,
                      Severity: Major
                      Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 5 hrs to fix

                        Function attr has 140 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            attr: function (hash, val) {
                                var wrapper = this,
                                    key,
                                    value,
                                    i,
                        Severity: Major
                        Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 5 hrs to fix

                          Function getOffset has 138 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              getOffset: function () {
                                  var axis = this,
                                      chart = axis.chart,
                                      renderer = chart.renderer,
                                      options = axis.options,
                          Severity: Major
                          Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 5 hrs to fix

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

                                    render: function () {
                                        var target = this.target,
                                            values = this.values,
                                            vlen = values.length,
                                            options = this.options,
                            Severity: Major
                            Found in app/assets/javascripts/external/jquery.sparkline.js - About 5 hrs to fix

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

                                              if (spotRadius && options.get('minSpotColor')) {
                                                  x = xvalues[$.inArray(this.minyorg, yvalues)];
                                                  target.drawCircle(canvasLeft + Math.round((x - this.minx) * (canvasWidth / rangex)),
                                                      canvasTop + Math.round(canvasHeight - (canvasHeight * ((this.minyorg - this.miny) / rangey))),
                                                      spotRadius, undefined,
                              Severity: Major
                              Found in app/assets/javascripts/external/jquery.sparkline.js and 1 other location - About 5 hrs to fix
                              app/assets/javascripts/external/jquery.sparkline.js on lines 1664..1670

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

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

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

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

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

                              Refactorings

                              Further Reading

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

                                              if (spotRadius && options.get('maxSpotColor')) {
                                                  x = xvalues[$.inArray(this.maxyorg, yvalues)];
                                                  target.drawCircle(canvasLeft + Math.round((x - this.minx) * (canvasWidth / rangex)),
                                                      canvasTop + Math.round(canvasHeight - (canvasHeight * ((this.maxyorg - this.miny) / rangey))),
                                                      spotRadius, undefined,
                              Severity: Major
                              Found in app/assets/javascripts/external/jquery.sparkline.js and 1 other location - About 5 hrs to fix
                              app/assets/javascripts/external/jquery.sparkline.js on lines 1657..1663

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

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

                                  buildText: function (wrapper) {
                                      var textNode = wrapper.element,
                                          renderer = this,
                                          forExport = renderer.forExport,
                                          lines = pick(wrapper.textStr, '').toString()
                              Severity: Major
                              Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 4 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language