datahuborg/datahub

View on GitHub

Showing 283 of 1,132 total issues

Function 1 has 111 lines of code (exceeds 25 allowed). Consider refactoring.
Open

(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
var api = require("./api.js");
var FilterBar = require("./filter-bar.js");
var Aggregator = require("./aggregator.js");
var table_header_template = require("./templates/table_header.hbs");
Severity: Major
Found in src/browser/static/datatables/js/dataTables.extra.js - About 4 hrs to fix

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

    $.fn.EnhancedDataTable = function(repo, table, query_callback, init_callback) {
      // The jquer object for which the EnhancedDataTable function was triggered.
      var jqueryObject = this;
      var filterBar;
      var aggregator;
    Severity: Major
    Found in src/apps/datatables/client/js/dataTables.extra.js - About 4 hrs to fix

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

      $.fn.EnhancedDataTable = function(repo, table, query_callback, init_callback) {
        // The jquer object for which the EnhancedDataTable function was triggered.
        var jqueryObject = this;
        var filterBar;
        var aggregator;
      Severity: Major
      Found in src/browser/static/datatables/js/dataTables.extra.js - About 4 hrs to fix

        Function renderZoom has 102 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            renderZoom: function(el) {
              var _this = this
                  yscales = this.state.yscales,
                  yaxis = this.state.yaxis,
                  xscales = this.state.xscales,
        Severity: Major
        Found in src/browser/static/dbwipes/js/summary/queryview.js - About 4 hrs to fix

          Function renderZoom has 102 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              renderZoom: function(el) {
                var _this = this
                    yscales = this.state.yscales,
                    yaxis = this.state.yaxis,
                    xscales = this.state.xscales,
          Severity: Major
          Found in src/apps/dbwipes/static/js/summary/queryview.js - About 4 hrs to fix

            Function 4 has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
            Open

            },{}],4:[function(require,module,exports){
            var filter_buttons_template = require("./templates/filter_buttons.hbs");
            var filter_template = require("./templates/filter.hbs");
            var delete_button_col = require("./templates/delete-button-col.hbs");
            
            
            Severity: Minor
            Found in src/browser/static/datatables/js/dataTables.extra.js - 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 12 has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

            },{"hbsfy/runtime":20}],12:[function(require,module,exports){
            // hbsfy compiled Handlebars template
            var HandlebarsCompiler = require('hbsfy/runtime');
            module.exports = HandlebarsCompiler.template({"1":function(depth0,helpers,partials,data) {
                var helper, alias1=helpers.helperMissing, alias2="function", alias3=this.escapeExpression;
            Severity: Minor
            Found in src/browser/static/datatables/js/dataTables.extra.js - 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 test_query_rewriter.py has 305 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            from core.db.query_rewriter import SQLQueryRewriter
            
            from django.db.models import signals
            from django.test import TestCase
            
            
            Severity: Minor
            Found in src/core/test/test_query_rewriter.py - About 3 hrs to fix

              File setup.js has 304 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              define(function(require) {
                var Backbone = require('backbone'),
                    $ = require('bootstrap'),
                    d3 = require('d3'),
                    _ = require('underscore'),
              Severity: Minor
              Found in src/browser/static/dbwipes/js/summary/setup.js - About 3 hrs to fix

                File setup.js has 304 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                define(function(require) {
                  var Backbone = require('backbone'),
                      $ = require('bootstrap'),
                      d3 = require('d3'),
                      _ = require('underscore'),
                Severity: Minor
                Found in src/apps/dbwipes/static/js/summary/setup.js - About 3 hrs to fix

                  Function 9 has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                  Open

                  },{"hbsfy/runtime":20}],9:[function(require,module,exports){
                  // hbsfy compiled Handlebars template
                  var HandlebarsCompiler = require('hbsfy/runtime');
                  module.exports = HandlebarsCompiler.template({"1":function(depth0,helpers,partials,data) {
                      var stack1, helper, alias1=helpers.helperMissing, alias2="function", alias3=this.escapeExpression;
                  Severity: Minor
                  Found in src/browser/static/datatables/js/dataTables.extra.js - 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 getTargetBounds has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      _Tether.prototype.getTargetBounds = function() {
                        var bounds, fitAdj, hasBottomScroll, height, out, scrollBottom, scrollPercentage, style, target;
                        if (this.targetModifier != null) {
                          switch (this.targetModifier) {
                            case 'visible':
                  Severity: Major
                  Found in src/apps/dbwipes/static/js/lib/tether.js - About 3 hrs to fix

                    Function 18 has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    },{}],18:[function(require,module,exports){
                    "use strict";
                    /*jshint -W004 */
                    var escape = {
                      "&": "&amp;",
                    Severity: Major
                    Found in src/browser/static/datatables/js/dataTables.extra.js - About 3 hrs to fix

                      Function getTargetBounds has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          _Tether.prototype.getTargetBounds = function() {
                            var bounds, fitAdj, hasBottomScroll, height, out, scrollBottom, scrollPercentage, style, target;
                            if (this.targetModifier != null) {
                              switch (this.targetModifier) {
                                case 'visible':
                      Severity: Major
                      Found in src/browser/static/dbwipes/js/lib/tether.js - About 3 hrs to fix

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

                            renderData: function(el) {
                              var col = this.model.get('col'),
                                  type = this.model.get('type'),
                                  stats = this.model.get('stats'),
                                  xscales = this.state.xscales,
                        Severity: Major
                        Found in src/browser/static/dbwipes/js/summary/cstatview.js - About 3 hrs to fix

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

                              renderBrushes: function(el) {
                                var xscales = this.state.xscales,
                                    h = this.state.h,
                                    type = this.model.get('type'),
                                    _this = this;
                          Severity: Major
                          Found in src/browser/static/dbwipes/js/summary/cstatview.js - About 3 hrs to fix

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

                                renderData: function(el) {
                                  var col = this.model.get('col'),
                                      type = this.model.get('type'),
                                      stats = this.model.get('stats'),
                                      xscales = this.state.xscales,
                            Severity: Major
                            Found in src/apps/dbwipes/static/js/summary/cstatview.js - About 3 hrs to fix

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

                                  renderBrushes: function(el) {
                                    var xscales = this.state.xscales,
                                        h = this.state.h,
                                        type = this.model.get('type'),
                                        _this = this;
                              Severity: Major
                              Found in src/apps/dbwipes/static/js/summary/cstatview.js - About 3 hrs to fix

                                Function __init__ has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def __init__(self, request):
                                        # First extract the easy variables.
                                        self.draw = int(request.GET["draw"])
                                        self.start = int(request.GET["start"])
                                        self.length = int(request.GET["length"])
                                Severity: Minor
                                Found in src/apps/datatables/models/draw_request.py - About 2 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 aggregate has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                                Open

                                def aggregate(request, repo, table, agg_type, col_name):
                                    username = request.user.get_username()
                                    manager = DataHubManager(username)
                                    repos = get_repos(manager)
                                    # Ensure that the repo exists.
                                Severity: Minor
                                Found in src/apps/datatables/views.py - About 2 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

                                Severity
                                Category
                                Status
                                Source
                                Language