datahuborg/datahub

View on GitHub

Showing 1,132 of 1,132 total issues

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

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

      def clean_str(text, prefix):
          string = text.strip().lower()
      
          # replace whitespace with '_'
          string = re.sub(' ', '_', string)
      Severity: Major
      Found in src/core/db/manager.py and 1 other location - About 5 hrs to fix
      src/browser/utils.py on lines 28..43

      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 86.

      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 clean_str(text, prefix):
          s = text.strip().lower()
      
          # replace whitespace with '_'
          s = re.sub(' ', '_', s)
      Severity: Major
      Found in src/browser/utils.py and 1 other location - About 5 hrs to fix
      src/core/db/manager.py on lines 1365..1380

      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 86.

      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 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

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

        for i in range(len(o_fields_structure)):
           for o_field_type in o_fields_structure[i][0]['type']:
            if o_field_type[0] == 'ENDMARKER':
              o_fields_types.append('ENDMARKER_%s' %(i))
            else:
      Severity: Major
      Found in src/apps/refiner/distill/inference.py and 1 other location - About 4 hrs to fix
      src/apps/refiner/distill/inference.py on lines 119..124

      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 85.

      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

        for i in range(len(o_fields_structure)):
           for o_field_type in o_fields_structure[i][0]['type']:
            if o_field_type[0] == 'ENDMARKER':
              o_fields_types.append('ENDMARKER_%s' %(i))
            else:
      Severity: Major
      Found in src/apps/refiner/distill/inference.py and 1 other location - About 4 hrs to fix
      src/apps/refiner/distill/inference.py on lines 82..87

      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 85.

      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 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 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 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/apps/dbwipes/static/js/summary/cstatview.js - About 4 hrs to fix

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

                  def setUp(self):
                      self.username = "delete_me_username"
                      self.repo_base = "delete_me_repo_base"
                      self.password = "delete_me_password"
              
              
              Severity: Major
              Found in src/api/test/test_collaborator_serializer.py and 2 other locations - About 4 hrs to fix
              src/api/test/test_repo_serializer.py on lines 11..22
              src/api/test/test_table_serializer.py on lines 11..22

              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 82.

              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 3 locations. Consider refactoring.
              Open

                  def setUp(self):
                      self.username = "delete_me_username"
                      self.repo_base = "delete_me_repo_base"
                      self.password = "delete_me_password"
              
              
              Severity: Major
              Found in src/api/test/test_repo_serializer.py and 2 other locations - About 4 hrs to fix
              src/api/test/test_collaborator_serializer.py on lines 11..22
              src/api/test/test_table_serializer.py on lines 11..22

              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 82.

              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 3 locations. Consider refactoring.
              Open

                  def setUp(self):
                      self.username = "delete_me_username"
                      self.repo_base = "delete_me_repo_base"
                      self.password = "delete_me_password"
              
              
              Severity: Major
              Found in src/api/test/test_table_serializer.py and 2 other locations - About 4 hrs to fix
              src/api/test/test_collaborator_serializer.py on lines 11..22
              src/api/test/test_repo_serializer.py on lines 11..22

              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 82.

              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 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

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

                    @login_required
                    def table_clone(request, repo_base, repo, table):
                        username = request.user.get_username()
                        new_table = request.GET.get('var_text', None)
                    
                    
                    Severity: Major
                    Found in src/browser/views.py and 1 other location - About 4 hrs to fix
                    src/browser/views.py on lines 1026..1035

                    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 80.

                    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

                    @login_required
                    def card_export(request, repo_base, repo, card_name):
                        username = request.user.get_username()
                        file_name = request.GET.get('var_text', card_name)
                    
                    
                    Severity: Major
                    Found in src/browser/views.py and 1 other location - About 4 hrs to fix
                    src/browser/views.py on lines 726..735

                    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 80.

                    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 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
                      Severity
                      Category
                      Status
                      Source
                      Language