sleepepi/sleepportal

View on GitHub

Showing 332 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

                              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

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

                                    render: function () {
                                        var plotLine = this,
                                            axis = plotLine.axis,
                                            horiz = axis.horiz,
                                            halfPointRange = (axis.pointRange || 0) / 2,
                                Severity: Major
                                Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 4 hrs to fix

                                  Function color has 123 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      color: function (color, elem, prop, wrapper) {
                                          var renderer = this,
                                              colorObject,
                                              regexRgba = /^rgba/,
                                              markup,
                                  Severity: Major
                                  Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 4 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language