datahuborg/datahub

View on GitHub

Showing 283 of 1,132 total issues

File shepherd.js has 476 lines of code (exceeds 250 allowed). Consider refactoring.
Open

(function() {
  var ATTACHMENT, Evented, Shepherd, Step, Tour, addClass, createFromHTML, extend, getBounds, hasClass, matchesSelector, parseShorthand, removeClass, uniqueId, _ref,
    __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
Severity: Minor
Found in src/apps/dbwipes/static/js/lib/shepherd.js - About 7 hrs to fix

    Function 16 has 182 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    },{}],16:[function(require,module,exports){
    "use strict";
    var Utils = require("./utils");
    var Exception = require("./exception")["default"];
    var COMPILER_REVISION = require("./base").COMPILER_REVISION;
    Severity: Major
    Found in src/browser/static/datatables/js/dataTables.extra.js - About 7 hrs to fix

      File test_manager.py has 468 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      from core.db.manager import DataHubManager
      from core.db.errors import PermissionDenied
      from psycopg2 import InternalError, ProgrammingError
      
      from contextlib import contextmanager
      Severity: Minor
      Found in src/integration_tests/test_manager.py - About 7 hrs to fix

        SchemaListCreateDeleteShare has 46 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class SchemaListCreateDeleteShare(MockingMixin, TestCase):
            """
            Tests that items reach the execute_sql method in pg.py.
        
            Does not test execute_sql itself.
        Severity: Minor
        Found in src/core/test/test_connector_pg.py - About 6 hrs to fix

          Function setupBasic has 145 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            var setupBasic = function() {
              var q = new Query();
              var qv = new QueryView({ model: q })
              $("#right").prepend(qv.render().$el);
          
          
          Severity: Major
          Found in src/apps/dbwipes/static/js/summary/setup.js - About 5 hrs to fix

            Function setupBasic has 145 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              var setupBasic = function() {
                var q = new Query();
                var qv = new QueryView({ model: q })
                $("#right").prepend(qv.render().$el);
            
            
            Severity: Major
            Found in src/browser/static/dbwipes/js/summary/setup.js - About 5 hrs to fix

              Function where_clause has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
              Open

                  def where_clause(self):
                      # Figure out the types of the columns so we'll know whether to use
                      # numeric operations or string operations.
                      schema = self.manager.get_schema(self.repo, self.table)
                      type_for_col = {}
              Severity: Minor
              Found in src/apps/datatables/util/run_draw_request.py - About 5 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 serializer.py has 383 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              from rest_framework import serializers
              
              from django.contrib.auth.models import User
              from django.core.urlresolvers import reverse
              
              
              Severity: Minor
              Found in src/api/serializer.py - About 5 hrs to fix

                Function 4 has 129 lines of code (exceeds 25 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: Major
                Found in src/browser/static/datatables/js/dataTables.extra.js - About 5 hrs to fix

                  Function apply_row_level_security_base has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def apply_row_level_security_base(self, query):
                          '''
                          Takes in a SQL query and applies row level security to it. All table
                          references in the query are replaced with a subquery that only extracts
                          rows from the table for which the user is allowed to see.
                  Severity: Minor
                  Found in src/core/db/query_rewriter.py - About 5 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 position has 126 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      _Tether.prototype.position = function(flushChanges) {
                        var elementPos, elementStyle, height, left, manualOffset, manualTargetOffset, module, next, offset, offsetBorder, offsetParent, offsetParentSize, offsetParentStyle, offsetPosition, ret, scrollLeft, scrollTop, scrollbarSize, side, targetAttachment, targetOffset, targetPos, targetSize, top, width, _i, _j, _len, _len1, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6,
                          _this = this;
                        if (flushChanges == null) {
                          flushChanges = true;
                  Severity: Major
                  Found in src/browser/static/dbwipes/js/lib/tether.js - About 5 hrs to fix

                    Function position has 126 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        _Tether.prototype.position = function(flushChanges) {
                          var elementPos, elementStyle, height, left, manualOffset, manualTargetOffset, module, next, offset, offsetBorder, offsetParent, offsetParentSize, offsetParentStyle, offsetPosition, ret, scrollLeft, scrollTop, scrollbarSize, side, targetAttachment, targetOffset, targetPos, targetSize, top, width, _i, _j, _len, _len1, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6,
                            _this = this;
                          if (flushChanges == null) {
                            flushChanges = true;
                    Severity: Major
                    Found in src/apps/dbwipes/static/js/lib/tether.js - About 5 hrs to fix

                      Function 18 has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                      Open

                      },{}],18:[function(require,module,exports){
                      "use strict";
                      /*jshint -W004 */
                      var escape = {
                        "&": "&",
                      Severity: Minor
                      Found in src/browser/static/datatables/js/dataTables.extra.js - About 4 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 template has 119 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function template(templateSpec, env) {
                        /* istanbul ignore next */
                        if (!env) {
                          throw new Exception("No environment passed to template");
                        }
                      Severity: Major
                      Found in src/browser/static/datatables/js/dataTables.extra.js - About 4 hrs to fix

                        Function registerDefaultHelpers has 118 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function registerDefaultHelpers(instance) {
                          instance.registerHelper('helperMissing', function(/* [args, ]options */) {
                            if(arguments.length === 1) {
                              // A missing field in a {{foo}} constuct.
                              return undefined;
                        Severity: Major
                        Found in src/browser/static/datatables/js/dataTables.extra.js - About 4 hrs to fix

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

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

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

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

                              Function Query has 115 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                DataQ.Query = function() {
                                  
                                  // Create the object and initialize the objects.
                                  var that = {};
                                  that._schema_for_table_name = {};
                              Severity: Major
                              Found in src/apps/dataq/client_src/js/dq-query.js - About 4 hrs to fix

                                Function move has 113 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    _Tether.prototype.move = function(position) {
                                      var css, elVal, found, key, moved, offsetParent, point, same, transcribe, type, val, write, writeCSS, _i, _len, _ref1, _ref2,
                                        _this = this;
                                      if (this.element.parentNode == null) {
                                        return;
                                Severity: Major
                                Found in src/browser/static/dbwipes/js/lib/tether.js - About 4 hrs to fix

                                  Function move has 113 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      _Tether.prototype.move = function(position) {
                                        var css, elVal, found, key, moved, offsetParent, point, same, transcribe, type, val, write, writeCSS, _i, _len, _ref1, _ref2,
                                          _this = this;
                                        if (this.element.parentNode == null) {
                                          return;
                                  Severity: Major
                                  Found in src/apps/dbwipes/static/js/lib/tether.js - About 4 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language