FanaHOVA/blazer

View on GitHub

Showing 544 of 841 total issues

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

module.exports = function(Chart) {

    var helpers = Chart.helpers;
    // Default config for a category scale
    var defaultConfig = {
Severity: Major
Found in app/assets/javascripts/blazer/Chart.js - About 3 hrs to fix

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

    module.exports = function(Chart) {
    
        var helpers = Chart.helpers;
    
        Chart.defaults.global.plugins = {};
    Severity: Major
    Found in app/assets/javascripts/blazer/Chart.js - About 3 hrs to fix

      Method process_vars has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
      Open

            def process_vars(statement, data_source)
              (@bind_vars ||= []).concat(Blazer.extract_vars(statement)).uniq!
              @bind_vars.each do |var|
                params[var] ||= Blazer.data_sources[data_source].variable_defaults[var]
              end
      Severity: Minor
      Found in app/controllers/blazer/base_controller.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 enter has 85 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function enter (vnode) {
        var el = vnode.elm;
      
        // call leave callback now
        if (el._leaveCb) {
      Severity: Major
      Found in app/assets/javascripts/blazer/vue.js - About 3 hrs to fix

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

        function Animation( elem, properties, options ) {
          var result,
            stopped,
            index = 0,
            length = animationPrefilters.length,
        Severity: Major
        Found in app/assets/javascripts/blazer/jquery.js - About 3 hrs to fix

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

          },{}],37:[function(require,module,exports){
          'use strict';
          
          module.exports = function(Chart) {
          
          
          Severity: Major
          Found in app/assets/javascripts/blazer/Chart.js - About 3 hrs to fix

            Consider simplifying this complex logical expression.
            Open

                if (!GoogleChartsAdapter && window.google && (window.google.setOnLoadCallback || window.google.charts)) {
                  GoogleChartsAdapter = new function () {
                    var google = window.google;
            
                    this.name = "google";
            Severity: Critical
            Found in app/assets/javascripts/blazer/chartkick.js - About 3 hrs to fix

              Function getParseRegexForToken has 83 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function getParseRegexForToken(token, config) {
                      var a, strict = config._strict;
                      switch (token) {
                      case 'Q':
                          return parseTokenOneDigit;
              Severity: Major
              Found in app/assets/javascripts/blazer/moment.js - About 3 hrs to fix

                Function 39 has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                },{}],39:[function(require,module,exports){
                'use strict';
                
                module.exports = function(Chart) {
                
                
                Severity: Major
                Found in app/assets/javascripts/blazer/Chart.js - About 3 hrs to fix

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

                  module.exports = function(Chart) {
                  
                      var helpers = Chart.helpers,
                          globalOpts = Chart.defaults.global;
                  
                  
                  Severity: Major
                  Found in app/assets/javascripts/blazer/Chart.js - About 3 hrs to fix

                    Method detect_anomaly has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def detect_anomaly
                          anomaly = nil
                          message = nil
                    
                          if rows.empty?
                    Severity: Minor
                    Found in lib/blazer/result.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

                    File jquery_ujs.js has 302 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    (function($, undefined) {
                    
                    /**
                     * Unobtrusive scripting adapter for jQuery
                     * https://github.com/rails/jquery-ujs
                    Severity: Minor
                    Found in app/assets/javascripts/blazer/jquery_ujs.js - About 3 hrs to fix

                      Function exports has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      module.exports = function(Chart) {
                      
                          var helpers = Chart.helpers,
                              globalOpts = Chart.defaults.global,
                              defaultColor = globalOpts.defaultColor;
                      Severity: Major
                      Found in app/assets/javascripts/blazer/Chart.js - About 3 hrs to fix

                        Function createChart has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          function createChart(chartType, chart, element, dataSource, opts, processData) {
                            var elementId;
                            if (typeof element === "string") {
                              elementId = element;
                              element = document.getElementById(element);
                        Severity: Major
                        Found in app/assets/javascripts/blazer/chartkick.js - About 3 hrs to fix

                          Function Sizzle has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function Sizzle( selector, context, results, seed ) {
                            var match, elem, m, nodeType,
                              // QSA vars
                              i, groups, old, nid, newContext, newSelector;
                          
                          
                          Severity: Major
                          Found in app/assets/javascripts/blazer/jquery.js - About 3 hrs to fix

                            Function fit has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    fit: function() {
                                        var me = this;
                                        var opts = me.options;
                                        var labelOpts = opts.labels;
                                        var display = opts.display;
                            Severity: Major
                            Found in app/assets/javascripts/blazer/Chart.js - About 3 hrs to fix

                              Function onKeyDown has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  onKeyDown: function(e) {
                                    var isInput = e.target === this.$control_input[0];
                                    var self = this;
                              
                                    if (self.isLocked) {
                              Severity: Major
                              Found in app/assets/javascripts/blazer/selectize.js - About 3 hrs to fix

                                Consider simplifying this complex logical expression.
                                Open

                                            if (circumference < Math.PI * 2.0) {
                                                var startAngle = opts.rotation % (Math.PI * 2.0);
                                                startAngle += Math.PI * 2.0 * (startAngle >= Math.PI ? -1 : startAngle < -Math.PI ? 1 : 0);
                                                var endAngle = startAngle + circumference;
                                                var start = {x: Math.cos(startAngle), y: Math.sin(startAngle)};
                                Severity: Critical
                                Found in app/assets/javascripts/blazer/Chart.js - About 3 hrs to fix

                                  Function buildFragment has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    buildFragment: function( elems, context, scripts, selection ) {
                                      var j, elem, contains,
                                        tmp, tag, tbody, wrap,
                                        l = elems.length,
                                  
                                  
                                  Severity: Major
                                  Found in app/assets/javascripts/blazer/jquery.js - About 2 hrs to fix

                                    Function update has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            update: function(changed) {
                                                var me = this;
                                                var opts = me._options;
                                    
                                                // Need to regenerate the model because its faster than using extend and it is necessary due to the optimization in Chart.Element.transition
                                    Severity: Major
                                    Found in app/assets/javascripts/blazer/Chart.js - About 2 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language