CrazySquirrel/Utils

View on GitHub
lib/UtilsMain.ts

Summary

Maintainability
C
1 day
Test Coverage

Function implementationStaticMethods has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

  public static implementationStaticMethods(realObject: any, className?: string): void {
    if (
        !!realObject &&
        typeof realObject === "object"
    ) {
Severity: Minor
Found in lib/UtilsMain.ts - About 3 hrs 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 stack has 65 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  public static stack(): any[] {
    const e: IError = new Error();
    return (
            e &&
            e.stack &&
Severity: Major
Found in lib/UtilsMain.ts - About 2 hrs to fix

Avoid deeply nested control flow statements.
Open

            if (typeof realObject[method] === "undefined") {

              realObject[method] = (...args) => {
                if (
                    typeof staticClass !== "undefined"
Severity: Major
Found in lib/UtilsMain.ts - About 45 mins to fix

Avoid too many return statements within this function.
Open

                    return {
                      column: match[3] || "",
                      file: match[1] || "",
                      line: match[2] || "",
                      method: "",
Severity: Major
Found in lib/UtilsMain.ts - About 30 mins to fix

Avoid too many return statements within this function.
Open

                    return {
                      column: match[4] || "",
                      file: match[2] || "",
                      line: match[3] || "",
                      method: match[1] || "",
Severity: Major
Found in lib/UtilsMain.ts - About 30 mins to fix

Avoid too many return statements within this function.
Open

                  return s;
Severity: Major
Found in lib/UtilsMain.ts - About 30 mins to fix

There are no issues that match your filters.

Category
Status