datahuborg/datahub

View on GitHub

Showing 1,132 of 1,132 total issues

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

module.exports = function(container, cd, dt) {
  var that = {};

  jqueryContainer = container;
  colDefs = cd;
Severity: Major
Found in src/apps/datatables/client/js/filter-bar.js and 1 other location - About 3 days to fix
src/browser/static/datatables/js/dataTables.extra.js on lines 373..439

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

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

module.exports = function(container, cd, dt) {
  var that = {};

  jqueryContainer = container;
  colDefs = cd;
Severity: Major
Found in src/browser/static/datatables/js/dataTables.extra.js and 1 other location - About 3 days to fix
src/apps/datatables/client/js/filter-bar.js on lines 91..157

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

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

define(function(require) {
  var $ = require("jquery"),
      CStatView = require('summary/cstatview'),
      Backbone = require('backbone');

Severity: Major
Found in src/browser/static/dbwipes/js/summary/cstatsview.js and 1 other location - About 2 days to fix
src/apps/dbwipes/static/js/summary/cstatsview.js on lines 2..51

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

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

define(function(require) {
  var $ = require("jquery"),
      CStatView = require('summary/cstatview'),
      Backbone = require('backbone');

Severity: Major
Found in src/apps/dbwipes/static/js/summary/cstatsview.js and 1 other location - About 2 days to fix
src/browser/static/dbwipes/js/summary/cstatsview.js on lines 2..51

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

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 manager.py has 1019 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import six
import hashlib
import os
import errno
import re
Severity: Major
Found in src/core/db/manager.py - About 2 days to fix

    File views.py has 1015 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import json
    import urllib
    import uuid
    import hashlib
    
    
    Severity: Major
    Found in src/browser/views.py - About 2 days to fix

      File dataTables.extra.js has 975 lines of code (exceeds 250 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 2 days to fix

        File pg.py has 951 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import re
        import os
        import errno
        import shutil
        import hashlib
        Severity: Major
        Found in src/core/db/backend/pg.py - About 2 days to fix

          Function 16 has a Cognitive Complexity of 111 (exceeds 5 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: Minor
          Found in src/browser/static/datatables/js/dataTables.extra.js - About 2 days 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 test_connector_pg.py has 876 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          from mock import Mock, \
                           MagicMock, \
                           patch, \
                           mock_open
          import itertools
          Severity: Major
          Found in src/core/test/test_connector_pg.py - About 2 days to fix

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

                @patch('core.db.backend.pg.os.makedirs')
                @patch('core.db.backend.pg.os.remove')
                @patch('core.db.backend.pg.shutil.move')
                def test_export_view(self, *args):
                    view_name = 'repo_name.view_name'
            Severity: Major
            Found in src/core/test/test_connector_pg.py and 2 other locations - About 2 days to fix
            src/core/test/test_connector_pg.py on lines 898..932
            src/core/test/test_connector_pg.py on lines 934..968

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

            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

                @patch('core.db.backend.pg.os.makedirs')
                @patch('core.db.backend.pg.os.remove')
                @patch('core.db.backend.pg.shutil.move')
                def test_export_table_with_header(self, *args):
                    table_name = 'repo_name.table_name'
            Severity: Major
            Found in src/core/test/test_connector_pg.py and 2 other locations - About 2 days to fix
            src/core/test/test_connector_pg.py on lines 934..968
            src/core/test/test_connector_pg.py on lines 970..1004

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

            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

                @patch('core.db.backend.pg.os.makedirs')
                @patch('core.db.backend.pg.os.remove')
                @patch('core.db.backend.pg.shutil.move')
                def test_export_table_with_no_header(self, *args):
                    table_name = 'repo_name.table_name'
            Severity: Major
            Found in src/core/test/test_connector_pg.py and 2 other locations - About 2 days to fix
            src/core/test/test_connector_pg.py on lines 898..932
            src/core/test/test_connector_pg.py on lines 970..1004

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

            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

            define(function(require) {
              var Backbone = require('backbone'),
                  Handlebars = require('handlebars'),
                  $ = require('jquery'),
                  d3 = require('d3'),
            Severity: Major
            Found in src/apps/dbwipes/static/js/summary/querywhereview.js and 1 other location - About 2 days to fix
            src/browser/static/dbwipes/js/summary/querywhereview.js on lines 1..45

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

            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

            define(function(require) {
              var Backbone = require('backbone'),
                  Handlebars = require('handlebars'),
                  $ = require('jquery'),
                  d3 = require('d3'),
            Severity: Major
            Found in src/browser/static/dbwipes/js/summary/querywhereview.js and 1 other location - About 2 days to fix
            src/apps/dbwipes/static/js/summary/querywhereview.js on lines 1..45

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

            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

            define(function(require) {
              var Backbone = require('backbone'),
                  Handlebars = require('handlebars'),
                  $ = require('jquery'),
                  d3 = require('d3'),
            Severity: Major
            Found in src/browser/static/dbwipes/js/summary/selectionview.js and 1 other location - About 2 days to fix
            src/apps/dbwipes/static/js/summary/selectionview.js on lines 1..51

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

            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

            define(function(require) {
              var Backbone = require('backbone'),
                  Handlebars = require('handlebars'),
                  $ = require('jquery'),
                  d3 = require('d3'),
            Severity: Major
            Found in src/apps/dbwipes/static/js/summary/selectionview.js and 1 other location - About 2 days to fix
            src/browser/static/dbwipes/js/summary/selectionview.js on lines 1..51

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

            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

            define(function(require) {
              var Backbone = require('backbone'),
                  Handlebars = require('handlebars'),
                  $ = require('jquery'),
                  d3 = require('d3'),
            Severity: Major
            Found in src/browser/static/dbwipes/js/summary/scorpionresultview.js and 1 other location - About 1 day to fix
            src/apps/dbwipes/static/js/summary/scorpionresultview.js on lines 1..56

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

            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

            define(function(require) {
              var Backbone = require('backbone'),
                  Handlebars = require('handlebars'),
                  $ = require('jquery'),
                  d3 = require('d3'),
            Severity: Major
            Found in src/apps/dbwipes/static/js/summary/scorpionresultview.js and 1 other location - About 1 day to fix
            src/browser/static/dbwipes/js/summary/scorpionresultview.js on lines 1..56

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

            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

            @csrf_exempt
            def service_account_binary(request):
                # Catch CORS preflight requests
                if request.method == 'OPTIONS':
                    resp = HttpResponse('')
            Severity: Major
            Found in src/browser/views.py and 1 other location - About 1 day to fix
            src/browser/views.py on lines 67..96

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

            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