crossfilter/universe

View on GitHub

Showing 52 of 61 total issues

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

module.exports = function (service) {
  var filters = require('./filters')(service)

  return function reductiofy(query) {
    var reducer = reductio()
Severity: Minor
Found in src/reductiofy.js - About 1 hr to fix

    Function universe has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function universe(data, options) {
      var service = {
        options: _.assign({}, options),
        columns: [],
        filters: {},
    Severity: Minor
    Found in src/universe.js - About 1 hr to fix

      Function reductiofy has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        return function reductiofy(query) {
          var reducer = reductio()
          // var groupBy = query.groupBy // groupBy is defined but never used
          aggregateOrNest(reducer, query.select)
      
      
      Severity: Minor
      Found in src/reductiofy.js - About 1 hr to fix

        Function convertAggregatorString has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function convertAggregatorString(keyString) {
          // var obj = {} // obj is defined but not used
        
          // 1. unwrap top parentheses
          // 2. detect arrays
        Severity: Minor
        Found in src/aggregation.js - About 1 hr to fix

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

          module.exports = function (service) {
            return {
              make: make,
              makeAccessor: makeAccessor,
            }
          Severity: Minor
          Found in src/dimension.js - About 1 hr to fix

            Function buildFilterObject has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function buildFilterObject(fil, isRange, replace) {
                if (_.isUndefined(fil)) {
                  return false
                }
                if (_.isFunction(fil)) {
            Severity: Minor
            Found in src/filters.js - About 1 hr to fix

              Function ds has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  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) {
                      return Promise.resolve()
              Severity: Minor
              Found in src/filters.js - About 1 hr to fix

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

                  function unwrapParensAndCommas(str) {
                    str = str.replace(' ', '')
                    return (
                      '"' +
                      str.replace(outerParens, function(p, pr) {
                Severity: Minor
                Found in src/aggregation.js - About 1 hr to fix

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

                  function recurseObject(obj, cb) {
                    _recurseObject(obj, [])
                    return obj
                    function _recurseObject(obj, path) {
                      for (var k in obj) { //  eslint-disable-line guard-for-in
                  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

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

                  function makeSubAggregationFunction(obj) {
                    // If its an object, either unwrap all of the properties as an
                    // array of keyValues, or unwrap the first keyValue set as an object
                    obj = _.isObject(obj) ? extractKeyValOrArray(obj) : obj
                  
                  
                  Severity: Minor
                  Found in src/aggregation.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

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

                          function buildColumnKeys(changes) {
                            if (column.key === true) {
                              return Promise.resolve()
                            }
                  
                  
                  Severity: Minor
                  Found in src/column.js - About 1 hr to fix

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

                    function makeSubAggregationFunction(obj) {
                      // If its an object, either unwrap all of the properties as an
                      // array of keyValues, or unwrap the first keyValue set as an object
                      obj = _.isObject(obj) ? extractKeyValOrArray(obj) : obj
                    
                    
                    Severity: Minor
                    Found in src/aggregation.js - About 1 hr to fix

                      Function map has 26 lines of code (exceeds 25 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 1 hr to fix

                        Function assign has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function assign(out) {
                          out = out || {}
                          for (var i = 1; i < arguments.length; i++) {
                            if (!arguments[i]) {
                              continue
                        Severity: Minor
                        Found in src/lodash.js - About 55 mins 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 a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                        module.exports = function (/* service */) {
                          return {
                            post: post,
                            sortByKey: sortByKey,
                            limit: limit,
                        Severity: Minor
                        Found in src/postAggregation.js - About 55 mins 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 a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                        module.exports = function (service) {
                          return {
                            make: make,
                            makeAccessor: makeAccessor,
                          }
                        Severity: Minor
                        Found in src/dimension.js - About 45 mins 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 squash has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                          function squash(query, parent, start, end, aggObj, label) {
                        Severity: Minor
                        Found in src/postAggregation.js - About 45 mins to fix

                          Function change has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                            function change(query, parent, start, end, aggObj) {
                          Severity: Minor
                          Found in src/postAggregation.js - About 35 mins to fix

                            Function forEach has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                            function forEach(a, b) {
                              if (isObject(a)) {
                                for (var key in a) {
                                  if (a.hasOwnProperty(key)) {
                                    b(a[key], key, a)
                            Severity: Minor
                            Found in src/lodash.js - About 35 mins 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 a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                            module.exports = function (service) {
                              return {
                                build: build,
                                generateColumns: generateColumns,
                                add: add,
                            Severity: Minor
                            Found in src/crossfilter.js - About 35 mins 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