sjsyrek/maryamyriameliamurphies.js

View on GitHub

Showing 84 of 84 total issues

Avoid too many return statements within this function.
Open

    if (type(head(xs)) === type(head(ys))) { return cons(head(xs))(listAppend(tail(xs))(ys)); }
Severity: Major
Found in source/list/func.js - About 30 mins to fix

    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 a < b ? LT : GT;
      Severity: Major
      Found in source/ord.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            return error.listError(as, takeWhile);
        Severity: Major
        Found in source/list/sub.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

            return cons(cons(x)(hComp))(transpose(cons(xs)(tComp)));
          Severity: Major
          Found in source/list/trans.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                return error.listError(as, dropWhile);
            Severity: Major
            Found in source/list/sub.js - About 30 mins to fix

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

              export const intercalate = (xs, xss) => {
                const intercalate_ = (xs, xss) => concat(intersperse(xs, xss));
                return partial(intercalate_, xs, xss);
              }
              Severity: Minor
              Found in source/list/trans.js and 1 other location - About 30 mins to fix
              source/list/folds.js on lines 65..68

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

              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 error.typeMismatch(a, b, compare);
              Severity: Major
              Found in source/ord.js - About 30 mins to fix

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

                export const concatMap = (f, xs) => {
                  const concatMap_ = (f, xs) => concat(map(f, xs));
                  return partial(concatMap_, f, xs);
                }
                Severity: Minor
                Found in source/list/folds.js and 1 other location - About 30 mins to fix
                source/list/trans.js on lines 135..138

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

                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 cons(f(x, y, z))(zipWith3(f, 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(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 Nothing;
                    Severity: Major
                    Found in source/list/sub.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                          return index(xs)(n - 1);
                      Severity: Major
                      Found in source/list/indexing.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                            return error.returnError(f, filter);
                        Severity: Major
                        Found in source/list/searching.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                              return compare(head(as), head(bs));
                          Severity: Major
                          Found in source/list/list.js - About 30 mins to fix

                            Function cons has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                            export const cons = (x, xs) => {
                              const cons_ = (x, xs) => {
                                if (isList(xs) === false) { return error.listError(xs, cons); }
                                if (isEmpty(xs)) { return new List(x, emptyList); }
                                if (typeCheck(x, head(xs))) { return new List(x, xs); }
                            Severity: Minor
                            Found in source/list/func.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

                            Function compare has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                              static compare(as, bs) {
                                if (isEmpty(as) && isEmpty(bs)) { return EQ; }
                                if (isEmpty(as) && isEmpty(bs) === false) { return LT; }
                                if (isEmpty(as) === false && isEmpty(bs)) { return GT; }
                                if (compare(head(as), head(bs)) === EQ) { return compare(tail(as), tail(bs)); }
                            Severity: Minor
                            Found in source/list/list.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

                            Function compare has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                              static compare(a, b) {
                                if (this.isEq(a, b)) { return EQ; }
                                let i = 1;
                                while (i in a) {
                                  if (a[i] < b[i]) { return LT; }
                            Severity: Minor
                            Found in source/tuple/tuple.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

                            Function and has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                            export const and = (a, b) => {
                              const and_ = (a, b) => {
                                if (typeof a !== `boolean`) { return error.typeError(a, and); }
                                if (typeof b !== `boolean`) { return error.typeError(b, and); }
                                if (a) { return b; }
                            Severity: Minor
                            Found in source/base/bool.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

                            Function concat has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                            export const concat = xss => {
                              if (isList(xss)) {
                                if (isEmpty(xss)) { return emptyList; }
                                const x = head(xss);
                                const xs = tail(xss);
                            Severity: Minor
                            Found in source/list/folds.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