crossfilter/universe

View on GitHub

Showing 61 of 61 total issues

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

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

        forEach(a, function (aa) {
          if (b.indexOf(aa) === -1) {
            return unique.push(aa)
          }
        })
      Severity: Minor
      Found in src/lodash.js and 1 other location - About 35 mins to fix
      src/lodash.js on lines 201..205

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

      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

        forEach(b, function (bb) {
          if (a.indexOf(bb) === -1) {
            return unique.push(bb)
          }
        })
      Severity: Minor
      Found in src/lodash.js and 1 other location - About 35 mins to fix
      src/lodash.js on lines 196..200

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

      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

      Avoid too many return statements within this function.
      Open

        return true
      Severity: Major
      Found in src/lodash.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            return 'string'
        Severity: Major
        Found in src/column.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                return Promise.resolve(column.dimension.filterAll())
          Severity: Major
          Found in src/filters.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return function (d) {
                    return expressions.$and(d, function (d) {
                      return _.map(subGetters, function (getSub) {
                        return getSub(d)
                      })
            Severity: Major
            Found in src/filters.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  return false
              Severity: Major
              Found in src/filters.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return {
                      value: fil,
                      replace: replace,
                      type: 'exact',
                    }
                Severity: Major
                Found in src/filters.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return false
                  Severity: Major
                  Found in src/lodash.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                      return []
                    Severity: Major
                    Found in src/aggregation.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return Promise.resolve(column.dimension.filterFunction(function (d) {
                                return fil.value.indexOf(d) > -1
                              }))
                      Severity: Major
                      Found in src/filters.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return Promise.resolve(column.dimension.filterFunction(fil.function))
                        Severity: Major
                        Found in src/filters.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                  return function (d) {
                                    return _.map(subGetters, function (getSub) {
                                      return getSub(d)
                                    })
                                  }
                          Severity: Major
                          Found in src/filters.js - About 30 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language