astuanax/fun

View on GitHub

Showing 4 of 4 total issues

tokens has 28 functions (exceeds 20 allowed). Consider refactoring.
Open

const tokens = {
  YYYY: d => fill(4, d.getFullYear()),
  YY: d => lastN(2, fill(4, d.getFullYear())),
  MMMM: d => MONTHS[d.getMonth()],
  MMM: d => firstN(3, MONTHS[d.getMonth()]),
Severity: Minor
Found in src/date/formatDateTime.js - About 3 hrs to fix

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

    const merge = curry((objL, objR) => {
      let result = Object.assign({}, objL)
    
      if (identical(objL, objR)) {
        return Object.assign({}, objL)
    Severity: Minor
    Found in src/object/merge.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 equals has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    export default curry(function equals (x, y) {
      if (identical(x, y)) return true
    
      if (type(x) !== type(y)) return false
    
    
    Severity: Minor
    Found in src/equals.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 path has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    export default curry(function path (path, obj) {
      let val = obj
      let idx = 0
      let p
      while (idx < path.length) {
    Severity: Minor
    Found in src/object/path.js - About 25 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