CrazySquirrel/CSDebug

View on GitHub

Showing 23 of 25 total issues

Function getLogRects has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
Open

  public getLogRects(strMode?: any, strMessage?: any, strStackMethod?: string, strStackFile?: string): any {
    /**
     * Result log stack
     */
    const arrResultLog = [];
Severity: Minor
Found in lib/CSDebug.ts - About 6 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

File CSDebug.ts has 441 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"use strict";
/**
 * Import interface
 */
import ICSDebug from "../Interfaces/ICSDebug";
Severity: Minor
Found in lib/CSDebug.ts - About 6 hrs to fix

Function write has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

  public write(mode: string, strMessage: any): void {
    if (
        mode &&
        strMessage
    ) {
Severity: Minor
Found in lib/CSDebug.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 _warn has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

  public _warn(strMessage: any, ...AdditionalMessage: any[]) {
    if (that) {
      /**
       * If use Debug, then call error method, or call default warn console method
       */
Severity: Minor
Found in lib/CSDebug.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 _error has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

  public _error(strMessage: any, ...AdditionalMessage: any[]) {
    if (that) {
      /**
       * If use Debug, then call error method, or call default error console method
       */
Severity: Minor
Found in lib/CSDebug.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 _info has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

  public _info(strMessage: any, ...AdditionalMessage: any[]) {
    if (that) {
      /**
       * If use Debug, then call error method, or call default info console method
       */
Severity: Minor
Found in lib/CSDebug.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 _debug has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

  public _debug(strMessage: any, ...AdditionalMessage: any[]) {
    if (that) {
      /**
       * If use Debug, then call error method, or call default debug console method
       */
Severity: Minor
Found in lib/CSDebug.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 _log has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

  public _log(strMessage: any, ...AdditionalMessage: any[]) {
    if (that) {
      /**
       * If use Debug, then call error method, or call default log console method
       */
Severity: Minor
Found in lib/CSDebug.ts - About 2 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 getLogRects has 69 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  public getLogRects(strMode?: any, strMessage?: any, strStackMethod?: string, strStackFile?: string): any {
    /**
     * Result log stack
     */
    const arrResultLog = [];
Severity: Major
Found in lib/CSDebug.ts - About 2 hrs to fix

Consider simplifying this complex logical expression.
Open

    if (typeof root !== "undefined") {
      /**
       * Save default window console methods
       */
      this.console = {
Severity: Critical
Found in lib/CSDebug.ts - About 2 hrs to fix

Function write has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  public write(mode: string, strMessage: any): void {
    if (
        mode &&
        strMessage
    ) {
Severity: Minor
Found in lib/CSDebug.ts - About 1 hr to fix

Consider simplifying this complex logical expression.
Open

              if (
                  (
                      (typeof strStackMethod === "string" && strStackMethod) &&
                      typeof stack.method === "string" &&
                      stack.method.indexOf(strStackMethod) === -1
Severity: Critical
Found in lib/CSDebug.ts - About 1 hr to fix

Consider simplifying this complex logical expression.
Open

    if (
        (
            strMode === undefined ||
            typeof strMode === "string"
        ) &&
Severity: Critical
Found in lib/CSDebug.ts - About 1 hr to fix

Function cloneObjectSafely has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  public static cloneObjectSafely(obj: any, deep: number): any {
    const newObj = {};
    if (deep < 2) {
      for (let j = 0; j < obj.length; j++) {
        const i = obj[j];
Severity: Minor
Found in lib/CSDebug.ts - 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 _debug has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  public _debug(strMessage: any, ...AdditionalMessage: any[]) {
    if (that) {
      /**
       * If use Debug, then call error method, or call default debug console method
       */
Severity: Minor
Found in lib/CSDebug.ts - About 1 hr to fix

Function _error has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  public _error(strMessage: any, ...AdditionalMessage: any[]) {
    if (that) {
      /**
       * If use Debug, then call error method, or call default error console method
       */
Severity: Minor
Found in lib/CSDebug.ts - About 1 hr to fix

Function _info has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  public _info(strMessage: any, ...AdditionalMessage: any[]) {
    if (that) {
      /**
       * If use Debug, then call error method, or call default info console method
       */
Severity: Minor
Found in lib/CSDebug.ts - About 1 hr to fix

Function _warn has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  public _warn(strMessage: any, ...AdditionalMessage: any[]) {
    if (that) {
      /**
       * If use Debug, then call error method, or call default warn console method
       */
Severity: Minor
Found in lib/CSDebug.ts - About 1 hr to fix

Function _log has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  public _log(strMessage: any, ...AdditionalMessage: any[]) {
    if (that) {
      /**
       * If use Debug, then call error method, or call default log console method
       */
Severity: Minor
Found in lib/CSDebug.ts - About 1 hr to fix

Consider simplifying this complex logical expression.
Open

        if (
            (
                (typeof strMode === "string" && strMode) &&
                log.mode !== strMode
            ) ||
Severity: Major
Found in lib/CSDebug.ts - About 1 hr to fix
Severity
Category
Status
Source
Language