smartprocure/futil-js

View on GitHub

Showing 6 of 20 total issues

File objects.spec.js has 885 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import chai from 'chai'
import * as F from '../src'
import _ from 'lodash/fp'

chai.expect()
Severity: Major
Found in test/objects.spec.js - About 2 days to fix

    File tree.spec.js has 636 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import chai from 'chai'
    import * as F from '../src'
    import _ from 'lodash/fp'
    import Promise from 'bluebird'
    
    
    Severity: Major
    Found in test/tree.spec.js - About 1 day to fix

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

      module.exports = function (config) {
        'use strict'
      
        let browsers
        let reporters
      Severity: Major
      Found in karma.conf.js - About 2 hrs to fix

        Function getDocs has 66 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        let getDocs = async () => {
          let jsDocToJson = _.flow(
            _.reject('undocumented'),
            _.reject({ kind: 'module' }),
            _.reject({ access: 'private' }),
        Severity: Major
        Found in scripts/generate-docs.js - About 2 hrs to fix

          File lens.spec.js has 273 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import chai from 'chai'
          import _ from 'lodash/fp'
          import * as F from '../src'
          
          chai.expect()
          Severity: Minor
          Found in test/lens.spec.js - About 2 hrs to fix

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

            let callUnless = (check) => (failFn) => (fn) => (x, y) =>
              check(x) ? failFn(y) : check(y) ? failFn(x) : fn(x, y)
            Severity: Minor
            Found in src/array.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

            Severity
            Category
            Status
            Source
            Language