datahuborg/datahub

View on GitHub

Showing 283 of 1,132 total issues

Function renderModifiedData has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    renderModifiedData: function(data) {
      var _this = this;
      this.$(".updated").remove();
      this.c.selectAll('g.data-container')
        .classed('background', false)
Severity: Minor
Found in src/browser/static/dbwipes/js/summary/queryview.js - About 1 hr to fix

    Function validate has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        validate: function() {
          var errs = [],
              yaliases = _.keys(this.get('badselection')),
              drawing = this.get('drawing');
    
    
    Severity: Minor
    Found in src/apps/dbwipes/static/js/summary/scorpionquery.js - About 1 hr to fix

      Function validate has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          validate: function() {
            var errs = [],
                yaliases = _.keys(this.get('badselection')),
                drawing = this.get('drawing');
      
      
      Severity: Minor
      Found in src/browser/static/dbwipes/js/summary/scorpionquery.js - About 1 hr to fix

        Function renderModifiedData has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            renderModifiedData: function(data) {
              var _this = this;
              this.$(".updated").remove();
              this.c.selectAll('g.data-container')
                .classed('background', false)
        Severity: Minor
        Found in src/apps/dbwipes/static/js/summary/queryview.js - About 1 hr to fix

          Method main has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            public static void main(String [] args) {
              try {
                // Before running you will need to populate the below variables
                // and create a corresponding repo and table in your datahub acount
                
          Severity: Minor
          Found in src/examples/java/src/SampleClient.java - About 1 hr to fix

            Function bindButtonEvents has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                Step.prototype.bindButtonEvents = function(cfg, el) {
                  var event, handler, page, _ref1,
                    _this = this;
                  if (cfg.events == null) {
                    cfg.events = {};
            Severity: Minor
            Found in src/apps/dbwipes/static/js/lib/shepherd.js - About 1 hr to fix

              Function bindButtonEvents has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  Step.prototype.bindButtonEvents = function(cfg, el) {
                    var event, handler, page, _ref1,
                      _this = this;
                    if (cfg.events == null) {
                      cfg.events = {};
              Severity: Minor
              Found in src/browser/static/dbwipes/js/lib/shepherd.js - About 1 hr to fix

                Function import_file has 9 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def import_file(username, repo_base, repo, table, file_name,
                Severity: Major
                Found in src/core/db/manager.py - About 1 hr to fix

                  Function brushf has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        var brushf = function(p) {
                          var e = brush.extent()
                          var selected = {};
                          el.selectAll('.data-container:not(.background)')
                              .selectAll('.mark')
                  Severity: Minor
                  Found in src/browser/static/dbwipes/js/summary/queryview.js - About 1 hr to fix

                    Function brushf has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          var brushf = function(p) {
                            var e = brush.extent()
                            var selected = {};
                            el.selectAll('.data-container:not(.background)')
                                .selectAll('.mark')
                    Severity: Minor
                    Found in src/apps/dbwipes/static/js/summary/queryview.js - About 1 hr to fix

                      Function get_columns_and_types has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def get_columns_and_types(self):
                              manager = DataHubManager(user=self.username, repo_base=self.repo_base)
                      
                              tokens = self.tablename.split('.')
                              repo = tokens[0]
                      Severity: Minor
                      Found in src/apps/dbwipes/summary.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 get_schema has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def get_schema(repo, table, username, repo_base):
                          """ gets the schema of a given repo.table in a repo_base """
                          manager = DataHubManager(user=username, repo_base=repo_base)
                          pairs = manager.get_schema(repo, table)
                          schema = {}
                      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 datahub_authenticate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def datahub_authenticate(username, password):
                          """
                          Analog of django.contrib.auth.authenticate.
                      
                          Given a username or email plus password, finds the User object, verifies
                      Severity: Minor
                      Found in src/account/utils.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 login has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def login(request):
                          """
                          DataHub account login form.
                      
                          GET returns and HttpResponse containing the account login form.
                      Severity: Minor
                      Found in src/account/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 forEachRowInColumn has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              datatable.forEachRowInColumn = function(colName, func) {
                                var targets = -1;
                                columnDefs.forEach(function(columnDef) {
                                  if (columnDef.name === colName) {
                                    targets = columnDef.targets;
                      Severity: Minor
                      Found in src/browser/static/datatables/js/dataTables.extra.js - About 1 hr to fix

                        Function FilterModal has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          DataQ.FilterModal = function(q, cb) {
                            // Set the instance variables.
                            callback = cb;
                            query = q;
                        
                        
                        Severity: Minor
                        Found in src/apps/dataq/client_src/js/dq-filter-modal.js - About 1 hr to fix

                          Function forEachRowInColumn has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  datatable.forEachRowInColumn = function(colName, func) {
                                    var targets = -1;
                                    columnDefs.forEach(function(columnDef) {
                                      if (columnDef.name === colName) {
                                        targets = columnDef.targets;
                          Severity: Minor
                          Found in src/apps/datatables/client/js/dataTables.extra.js - About 1 hr to fix

                            Function test_public_repo has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                def test_public_repo(self):
                                    # Django migrations.RunPython doesn't happen before each test.
                                    # To work around this we call some methods (that should have been done
                                    # in migrations) here.
                                    # Django 1.8/1.9 https://code.djangoproject.com/ticket/23640
                            Severity: Minor
                            Found in src/functional_tests/test_db.py - About 1 hr to fix

                              Function parse has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  parse: function(resp) {
                                    //
                                    // results: [ { score:, c_range:, clauses:, alt_clauses:, } ]
                                    // top_k_results: { 
                                    //  yalias: { 
                              Severity: Minor
                              Found in src/browser/static/dbwipes/js/summary/scorpionquery.js - About 1 hr to fix

                                Function parse has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    parse: function(resp) {
                                      //
                                      // results: [ { score:, c_range:, clauses:, alt_clauses:, } ]
                                      // top_k_results: { 
                                      //  yalias: { 
                                Severity: Minor
                                Found in src/apps/dbwipes/static/js/summary/scorpionquery.js - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language