datahuborg/datahub

View on GitHub

Showing 283 of 1,132 total issues

Function app_allow_access has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

def app_allow_access(request, app_id, repo_name):
    username = request.user.get_username()
    try:
        app = None
        try:
Severity: Minor
Found in src/browser/views.py - About 1 hr 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 find_and_insert has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      function find_and_insert(path, x, y) {
        var prev = null;
        var insertidx = null;
        var dir = (path.length == 1)? null : ((path[0][0] < path[path.length-1][0])? 'inc' : 'dec');
        for (var idx = 0; idx < path.length; idx++) {
Severity: Minor
Found in src/browser/static/dbwipes/js/summary/drawingview.js - About 1 hr to fix

    Function find_and_insert has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          function find_and_insert(path, x, y) {
            var prev = null;
            var insertidx = null;
            var dir = (path.length == 1)? null : ((path[0][0] < path[path.length-1][0])? 'inc' : 'dec');
            for (var idx = 0; idx < path.length; idx++) {
    Severity: Minor
    Found in src/apps/dbwipes/static/js/summary/drawingview.js - About 1 hr to fix

      Function show has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          Step.prototype.show = function() {
            var _this = this;
            if (this.el == null) {
              this.render();
              if (this.options.style) {
      Severity: Minor
      Found in src/apps/dbwipes/static/js/lib/shepherd.js - About 1 hr to fix

        Function show has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            Step.prototype.show = function() {
              var _this = this;
              if (this.el == null) {
                this.render();
                if (this.options.style) {
        Severity: Minor
        Found in src/browser/static/dbwipes/js/lib/shepherd.js - About 1 hr to fix

          Function onSubmit has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              onSubmit: function() {
                var db = this.$('input[name=q-db]').val(),
                    table = this.$('input[name=q-table]').val(),
                    xexpr = this.$('input[name=q-x-expr]').val(),
                    xcol = this.$('input[name=q-x-col]').val(),
          Severity: Minor
          Found in src/browser/static/dbwipes/js/summary/queryform.js - About 1 hr to fix

            Function onSubmit has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                onSubmit: function() {
                  var db = this.$('input[name=q-db]').val(),
                      table = this.$('input[name=q-table]').val(),
                      xexpr = this.$('input[name=q-x-expr]').val(),
                      xcol = this.$('input[name=q-x-col]').val(),
            Severity: Minor
            Found in src/apps/dbwipes/static/js/summary/queryform.js - About 1 hr to fix

              Function display_query has 44 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                var display_query = function() {
              
                  /**********************************/
                  /*** 1: Selected Tables/Columns ***/
                  /**********************************/
              Severity: Minor
              Found in src/apps/dataq/client_src/js/dataq.js - About 1 hr to fix

                Function 8 has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                },{"hbsfy/runtime":20}],8:[function(require,module,exports){
                // hbsfy compiled Handlebars template
                var HandlebarsCompiler = require('hbsfy/runtime');
                module.exports = HandlebarsCompiler.template({"compiler":[6,">= 2.0.0-beta.1"],"main":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 1 hr 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 apply_row_level_security_update has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                    def apply_row_level_security_update(self, query):
                        '''
                        Takes in an update SQL query and applies security policies related to
                        the update access type to it.
                        '''
                Severity: Minor
                Found in src/core/db/query_rewriter.py - About 1 hr 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 apply_row_level_security_insert has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                    def apply_row_level_security_insert(self, query):
                        '''
                        Takes in an insert SQL query and applies security policies related to
                        the insert access type to it. Currently, we only support one type
                        of insert permission -- which is that the user making the insert call
                Severity: Minor
                Found in src/core/db/query_rewriter.py - About 1 hr 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 updateAttachClasses has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    _Tether.prototype.updateAttachClasses = function(elementAttach, targetAttach) {
                      var add, all, side, sides, _i, _j, _len, _len1, _ref1,
                        _this = this;
                      if (elementAttach == null) {
                        elementAttach = this.attachment;
                Severity: Minor
                Found in src/apps/dbwipes/static/js/lib/tether.js - About 1 hr to fix

                  Function updateAttachClasses has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      _Tether.prototype.updateAttachClasses = function(elementAttach, targetAttach) {
                        var add, all, side, sides, _i, _j, _len, _len1, _ref1,
                          _this = this;
                        if (elementAttach == null) {
                          elementAttach = this.attachment;
                  Severity: Minor
                  Found in src/browser/static/dbwipes/js/lib/tether.js - About 1 hr to fix

                    Function renderAxes has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        renderAxes: function(el) {
                          if(el.select('.xaxis').size() == 0) {
                            var xel = el.append('g')
                              .attr('class', 'axis x xaxis')
                              .attr('transform', "translate(0,"+this.state.h+")");
                    Severity: Minor
                    Found in src/browser/static/dbwipes/js/summary/queryview.js - About 1 hr to fix

                      Function renderAxes has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          renderAxes: function(el) {
                            if(el.select('.xaxis').size() == 0) {
                              var xel = el.append('g')
                                .attr('class', 'axis x xaxis')
                                .attr('transform', "translate(0,"+this.state.h+")");
                      Severity: Minor
                      Found in src/apps/dbwipes/static/js/summary/queryview.js - About 1 hr to fix

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

                            renderData: function(el, data, xalias, yalias) {
                              var _this = this,
                                  h = this.state.h,
                                  w = this.state.w;
                              var data = _.map(data, function(d) {
                        Severity: Minor
                        Found in src/browser/static/dbwipes/js/summary/queryview.js - About 1 hr to fix

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

                              renderData: function(el, data, xalias, yalias) {
                                var _this = this,
                                    h = this.state.h,
                                    w = this.state.w;
                                var data = _.map(data, function(d) {
                          Severity: Minor
                          Found in src/apps/dbwipes/static/js/summary/queryview.js - About 1 hr to fix

                            Function index has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def index(request, repo_base, repo, table):
                                """ Main page for dbWipes """
                                username = request.user.get_username()
                                cache_exists = does_cache_exist(repo_base)
                            
                            
                            Severity: Minor
                            Found in src/apps/dbwipes/views.py - About 1 hr 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 getXDomain has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              function getXDomain(points, type, getx) {
                                var xdomain = null;
                            
                                if (isStr(type)) {
                                  xdomain = {};
                            Severity: Minor
                            Found in src/browser/static/dbwipes/js/summary/util.js - About 1 hr to fix

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

                                function getXDomain(points, type, getx) {
                                  var xdomain = null;
                              
                                  if (isStr(type)) {
                                    xdomain = {};
                              Severity: Minor
                              Found in src/apps/dbwipes/static/js/summary/util.js - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language