datahuborg/datahub

View on GitHub

Showing 1,132 of 1,132 total issues

File cstatview.js has 502 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// CSTatView
define(function(require) {
  var Handlebars = require('handlebars'),
      Backbone = require('backbone'),
      d3 = require('d3'),
Severity: Major
Found in src/browser/static/dbwipes/js/summary/cstatview.js - About 1 day to fix

    File cstatview.js has 502 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // CSTatView
    define(function(require) {
      var Handlebars = require('handlebars'),
          Backbone = require('backbone'),
          d3 = require('d3'),
    Severity: Major
    Found in src/apps/dbwipes/static/js/summary/cstatview.js - About 1 day to fix

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          def create_license_link_table(self):
              schema = settings.LICENSE_LINK_SCHEMA
              table = settings.LICENSE_LINK_TABLE
              public_role = settings.PUBLIC_ROLE
      
      
      Severity: Major
      Found in src/core/db/backend/pg.py and 1 other location - About 7 hrs to fix
      src/core/db/backend/pg.py on lines 942..964

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 121.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          def create_license_table(self):
              schema = settings.LICENSE_SCHEMA
              table = settings.LICENSE_TABLE
              public_role = settings.PUBLIC_ROLE
      
      
      Severity: Major
      Found in src/core/db/backend/pg.py and 1 other location - About 7 hrs to fix
      src/core/db/backend/pg.py on lines 966..986

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 121.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Function 14 has 195 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            toJSON: function() {
              var basewheres = this.get('basewheres') || [];
              basewheres = _.compact(_.flatten(basewheres));
              var where = this.get('where');
        
        
        Severity: Major
        Found in src/apps/dbwipes/static/js/summary/query.js and 1 other location - About 7 hrs to fix
        src/browser/static/dbwipes/js/summary/query.js on lines 167..186

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 191.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            toJSON: function() {
              var basewheres = this.get('basewheres') || [];
              basewheres = _.compact(_.flatten(basewheres));
              var where = this.get('where');
        
        
        Severity: Major
        Found in src/browser/static/dbwipes/js/summary/query.js and 1 other location - About 7 hrs to fix
        src/apps/dbwipes/static/js/summary/query.js on lines 168..187

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 191.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

          return "  <th data-colname=\""
            + alias3(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : alias1),(typeof helper === alias2 ? helper.call(depth0,{"name":"name","hash":{},"data":data}) : helper)))
            + "\">"
            + alias3(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : alias1),(typeof helper === alias2 ? helper.call(depth0,{"name":"name","hash":{},"data":data}) : helper)))
            + " <span class=\"gray\">("
        Severity: Major
        Found in src/browser/static/datatables/js/dataTables.extra.js and 1 other location - About 7 hrs to fix
        src/browser/static/datatables/js/dataTables.extra.js on lines 511..515

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 187.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

          return "<div class=\"input-group\">\n  <span class=\"input-group-btn\">\n    <button class=\"btn btn-danger dt-delete-button\" type=\"button\"><i class=\"fa fa-trash\"></i></button>\n    <button class=\"btn btn-default dt-op-button\" type=\"button\">=</button>\n  </span>\n  <input type=\"text\" class=\"form-control dt-filtertext\" placeholder=\""
            + alias3(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : alias1),(typeof helper === alias2 ? helper.call(depth0,{"name":"name","hash":{},"data":data}) : helper)))
            + "\" value=\""
            + alias3(((helper = (helper = helpers.value || (depth0 != null ? depth0.value : depth0)) != null ? helper : alias1),(typeof helper === alias2 ? helper.call(depth0,{"name":"value","hash":{},"data":data}) : helper)))
            + "\"> \n</div>\n";
        Severity: Major
        Found in src/browser/static/datatables/js/dataTables.extra.js and 1 other location - About 7 hrs to fix
        src/browser/static/datatables/js/dataTables.extra.js on lines 561..565

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 187.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

        def rename_duplicates(columns):
            columns = [c.lower() for c in columns]
            new_columns = []
            col_idx = {c: 1 for c in columns}
        
        
        Severity: Major
        Found in src/browser/utils.py and 1 other location - About 7 hrs to fix
        src/core/db/manager.py on lines 1383..1396

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 116.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

        def rename_duplicates(columns):
            columns = [c.lower() for c in columns]
            new_columns = []
            col_idx = {c: 1 for c in columns}
        
        
        Severity: Major
        Found in src/core/db/manager.py and 1 other location - About 7 hrs to fix
        src/browser/utils.py on lines 46..59

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 116.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

        api.get_column_definitions = function(repo, table, callback) {
          // Create the endpoint URL.
          var url = url_base + "schema/" + repo + "/" + table + "/";
        
          // Get the schema.
        Severity: Major
        Found in src/apps/datatables/client/js/api.js and 1 other location - About 7 hrs to fix
        src/browser/static/datatables/js/dataTables.extra.js on lines 240..267

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 184.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

        api.get_column_definitions = function(repo, table, callback) {
          // Create the endpoint URL.
          var url = url_base + "schema/" + repo + "/" + table + "/";
        
          // Get the schema.
        Severity: Major
        Found in src/browser/static/datatables/js/dataTables.extra.js and 1 other location - About 7 hrs to fix
        src/apps/datatables/client/js/api.js on lines 32..59

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 184.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        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/browser/static/dbwipes/js/lib/shepherd.js - About 7 hrs to fix

          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

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                def export_table(self, repo, table, file_name, file_format='CSV',
                                 delimiter=',', header=True):
                    """
                    Exports a table to a file in the same repo.
            
            
            Severity: Major
            Found in src/core/db/manager.py and 1 other location - About 7 hrs to fix
            src/core/db/manager.py on lines 736..767

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 114.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                def export_view(self, repo, view, file_format='CSV',
                                delimiter=',', header=True):
                    """
                    Exports a view to a file in the same repo.
            
            
            Severity: Major
            Found in src/core/db/manager.py and 1 other location - About 7 hrs to fix
            src/core/db/manager.py on lines 697..729

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 114.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            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

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                    @classmethod
                    def delete_all_test_users(cls):
                        # When building tests, it's possible to delete some combination of the
                        # django user/postgres user/postgres user database
                        # This tries to catch the edge cases.
                Severity: Major
                Found in src/integration_tests/test_manager.py and 1 other location - About 7 hrs to fix
                src/integration_tests/test_rlsmanager.py on lines 31..49

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 112.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Severity
                Category
                Status
                Source
                Language