sjsyrek/maryamyriameliamurphies.js

View on GitHub
source/list/zip.js

Summary

Maintainability
B
5 hrs
Test Coverage

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

export const zip3 = (as, bs, cs) => {
  const zip3_ = (as, bs, cs) => {
    if (isList(as) === false) { return error.listError(as, zip3); }
    if (isList(bs) === false) { return error.listError(bs, zip3); }
    if (isList(cs) === false) { return error.listError(cs, zip3); }
Severity: Minor
Found in source/list/zip.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 zip has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export const zip = (as, bs) => {
  const zip_ = (as, bs) => {
    if (isList(as) === false) { return error.listError(as, zip); }
    if (isList(bs) === false) { return error.listError(bs, zip); }
    if (isEmpty(as)) { return emptyList; }
Severity: Minor
Found in source/list/zip.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 zipWith3 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export const zipWith3 = (f, as, bs, cs) => {
  const zipWith3_ = (f, as, bs, cs) => {
    if (isList(as) === false) { return error.listError(as, zipWith3); }
    if (isList(bs) === false) { return error.listError(bs, zipWith3); }
    if (isList(cs) === false) { return error.listError(cs, zipWith3); }
Severity: Minor
Found in source/list/zip.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 zipWith has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export const zipWith = (f, as, bs) => {
  const zipWith_ = (f, as, bs) => {
    if (isList(as) === false) { return error.listError(as, zipWith); }
    if (isList(bs) === false) { return error.listError(bs, zipWith); }
    if (isEmpty(as) || isEmpty(bs)) { return emptyList; }
Severity: Minor
Found in source/list/zip.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

Avoid too many return statements within this function.
Open

    return cons(tuple(x, y))(zip(xs)(ys));
Severity: Major
Found in source/list/zip.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return cons(tuple(x, y, z))(zip3(xs, ys, zs));
    Severity: Major
    Found in source/list/zip.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          return cons(f(x, y, z))(zipWith3(f, xs, ys, zs));
      Severity: Major
      Found in source/list/zip.js - About 30 mins to fix

        There are no issues that match your filters.

        Category
        Status