sleepepi/sleepportal

View on GitHub

Showing 332 of 436 total issues

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

        init: function (el, values, options, width, height) {
            var barWidth = parseInt(options.get('barWidth'), 10),
                barSpacing = parseInt(options.get('barSpacing'), 10),
                chartRangeMin = options.get('chartRangeMin'),
                chartRangeMax = options.get('chartRangeMax'),
Severity: Major
Found in app/assets/javascripts/external/jquery.sparkline.js - About 4 hrs to fix

    Function initContainer has 117 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            initContainer: function () {
    
                var selection,
                    container = this.container,
                    dropdown = this.dropdown,
    Severity: Major
    Found in app/assets/javascripts/external/select2.js - About 4 hrs to fix

      Function prepareOpts has 112 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              prepareOpts: function (opts) {
                  var element, select, idKey, ajaxUrl;
      
                  element = opts.element;
      
      
      Severity: Major
      Found in app/assets/javascripts/external/select2.js - About 4 hrs to fix

        Function renderItem has 107 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          Function refresh has 107 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              refresh: function (point, mouseEvent) {
                  var tooltip = this,
                      chart = tooltip.chart,
                      label = tooltip.label,
                      options = tooltip.options,
          Severity: Major
          Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 4 hrs to fix

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

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

              Function redraw has 100 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  redraw: function (animation) {
                      var chart = this,
                          axes = chart.axes,
                          series = chart.series,
                          pointer = chart.pointer,
              Severity: Major
              Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 4 hrs to fix

                Method finalize_report_table has 98 lines of code (exceeds 25 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: Major
                Found in app/models/report.rb - About 3 hrs to fix

                  Method set_values has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def set_values
                      all_sources.each do |source|
                        wrapper = Aqueduct::Builder.wrapper(source, @current_user)
                  
                        mappings_for_select_clause = []
                  Severity: Minor
                  Found in app/models/master_resolver.rb - About 3 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 render has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

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

                    Function button has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        button: function (text, x, y, callback, normalState, hoverState, pressedState, disabledState, shape) {
                            var label = this.label(text, x, y, shape, null, null, null, null, 'button'),
                                curState = 0,
                                stateOptions,
                                stateStyle,
                    Severity: Major
                    Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 3 hrs to fix

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

                              init: function (pathAnim) {
                                  
                                  // extend the animate function to allow SVG animations
                                  var Fx = $.fx,
                                      Step = Fx.step,
                      Severity: Major
                      Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 3 hrs to fix

                        Function drawDataLabels has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            drawDataLabels: function () {
                                
                                var series = this,
                                    seriesOptions = series.options,
                                    cursor = seriesOptions.cursor,
                        Severity: Major
                        Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 3 hrs to fix

                          Function htmlUpdateTransform has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              htmlUpdateTransform: function () {
                                  // aligning non added elements is expensive
                                  if (!this.added) {
                                      this.alignOnAdd = true;
                                      return;
                          Severity: Major
                          Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 3 hrs to fix

                            Function drawChartBox has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

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

                              Function setData has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  setData: function (data, redraw) {
                                      var series = this,
                                          oldData = series.points,
                                          options = series.options,
                                          chart = series.chart,
                              Severity: Major
                              Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 3 hrs to fix

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

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

                                  Function getAttribs has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      getAttribs: function () {
                                          var series = this,
                                              seriesOptions = series.options,
                                              normalOptions = defaultPlotOptions[series.type].marker ? seriesOptions.marker : seriesOptions,
                                              stateOptions = normalOptions.states,
                                  Severity: Major
                                  Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 3 hrs to fix

                                    Function html has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        html: function (str, x, y) {
                                            var defaultChartStyle = defaultOptions.chart.style,
                                                wrapper = this.createElement('span'),
                                                attrSetters = wrapper.attrSetters,
                                                element = wrapper.element,
                                    Severity: Major
                                    Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 3 hrs to fix

                                      Function translate has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          translate: function (positions) {
                                              this.generatePoints();
                                              
                                              var series = this,
                                                  cumulative = 0,
                                      Severity: Major
                                      Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 3 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language