crossfilter/universe

View on GitHub

Showing 61 of 61 total issues

Function exports has a Cognitive Complexity of 82 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function (service) {
  return {
    filter: filter,
    filterAll: filterAll,
    applyFilters: applyFilters,
Severity: Minor
Found in src/filters.js - About 1 day 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 exports has 299 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function (service) {
  return {
    filter: filter,
    filterAll: filterAll,
    applyFilters: applyFilters,
Severity: Major
Found in src/filters.js - About 1 day to fix

    Function exports has 205 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function (service) {
      var reductiofy = require('./reductiofy')(service)
      var filters = require('./filters')(service)
      var postAggregation = require('./postAggregation')(service)
    
    
    Severity: Major
    Found in src/query.js - About 1 day to fix

      Function doQuery has 199 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        return function doQuery(queryObj) {
          var queryHash = JSON.stringify(queryObj)
      
          // Attempt to reuse an exact copy of this query that is present elsewhere
          for (var i = 0; i < service.columns.length; i++) {
      Severity: Major
      Found in src/query.js - About 7 hrs to fix

        Function exports has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
        Open

        module.exports = function (service) {
          var dimension = require('./dimension')(service)
        
          var columnFunc = column
          columnFunc.find = findColumn
        Severity: Minor
        Found in src/column.js - About 6 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

        Function exports has 135 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function (service) {
          var dimension = require('./dimension')(service)
        
          var columnFunc = column
          columnFunc.find = findColumn
        Severity: Major
        Found in src/column.js - About 5 hrs to fix

          Function exports has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
          Open

          module.exports = function (service) {
            var reductiofy = require('./reductiofy')(service)
            var filters = require('./filters')(service)
            var postAggregation = require('./postAggregation')(service)
          
          
          Severity: Minor
          Found in src/query.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

          Function makeColumn has 94 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function makeColumn(d) {
              var column = _.isObject(d) ? d : {
                key: d,
              }
          
          
          Severity: Major
          Found in src/column.js - About 3 hrs to fix

            Function exports has 89 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports = function (/* service */) {
              return {
                post: post,
                sortByKey: sortByKey,
                limit: limit,
            Severity: Major
            Found in src/postAggregation.js - About 3 hrs to fix

              File filters.js has 305 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              'use strict'
              
              var _ = require('./lodash')
              
              var expressions = require('./expressions')
              Severity: Minor
              Found in src/filters.js - About 3 hrs to fix

                Function makeFunction has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function makeFunction(obj, isAggregation) {
                    var subGetters
                
                    // Detect raw $data reference
                    if (_.isString(obj)) {
                Severity: Major
                Found in src/filters.js - About 3 hrs to fix

                  Function newQueryObj has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function newQueryObj(q, parent) {
                        var locked = false
                        if (!parent) {
                          parent = q
                          q = {}
                  Severity: Major
                  Found in src/query.js - About 3 hrs to fix

                    File lodash.js has 286 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /* eslint no-prototype-builtins: 0 */
                    'use strict'
                    
                    module.exports = {
                      assign: assign,
                    Severity: Minor
                    Found in src/lodash.js - About 2 hrs to fix

                      Function exports has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                      Open

                      module.exports = function(service) {
                        return function clear(def) {
                          // Clear a single or multiple column definitions
                          if (def) {
                            def = _.isArray(def) ? def : [def]
                      Severity: Minor
                      Found in src/clear.js - About 2 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

                      Function exports has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      module.exports = function (service) {
                        return {
                          build: build,
                          generateColumns: generateColumns,
                          add: add,
                      Severity: Major
                      Found in src/crossfilter.js - About 2 hrs to fix

                        Function applyFilters has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          function applyFilters(newFilters) {
                            var ds = _.map(newFilters, function (fil, i) {
                              var existing = service.filters[i]
                              // Filters are the same, so no change is needed on this column
                              if (fil === existing) {
                        Severity: Major
                        Found in src/filters.js - About 2 hrs to fix

                          Function exports has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          module.exports = function(service) {
                            return function clear(def) {
                              // Clear a single or multiple column definitions
                              if (def) {
                                def = _.isArray(def) ? def : [def]
                          Severity: Major
                          Found in src/clear.js - About 2 hrs to fix

                            Function clear has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              return function clear(def) {
                                // Clear a single or multiple column definitions
                                if (def) {
                                  def = _.isArray(def) ? def : [def]
                                }
                            Severity: Major
                            Found in src/clear.js - About 2 hrs to fix

                              Function map has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function map(a, b) {
                                var m
                                var key
                                if (isFunction(b)) {
                                  if (isObject(a)) {
                              Severity: Minor
                              Found in src/lodash.js - About 2 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

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

                              function isEqual(x, y) {
                                if ((typeof x === 'object' && x !== null) && (typeof y === 'object' && y !== null)) {
                                  if (Object.keys(x).length !== Object.keys(y).length) {
                                    return false
                                  }
                              Severity: Minor
                              Found in src/lodash.js - About 1 hr to fix

                              Cognitive Complexity

                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                              A method's cognitive complexity is based on a few simple rules:

                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                              • Code is considered more complex for each "break in the linear flow of the code"
                              • Code is considered more complex when "flow breaking structures are nested"

                              Further reading

                              Severity
                              Category
                              Status
                              Source
                              Language