Showing 5 of 11 total issues

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

export function compress () {
  let assetsPath = Config.getAssetsPath()

  if (!fs.existsSync(assetsPath)) {
    // TODO notify the user that no assets were found
Severity: Minor
Found in src/lib/compress.ts - About 1 hr to fix

    Function getStatusSection has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    function getStatusSection (tree: any) {
      let statusFlag = false
      let statusSection: string[] = []
      for (let i = 0; i < tree.length; i++) {
        let node = tree[i]
    Severity: Minor
    Found in src/lib/StatusHelper.ts - 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 buildGraphBuildFun has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function buildGraphBuildFun (index, decision, file, bodyString, filesLength): string[] {
    Severity: Minor
    Found in src/lib/generate.ts - About 35 mins to fix

      Function build has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        build () {
          if (typeof this.startString === 'string') {
            return this.startString + this.bodyString.join('') + this.endString
          }
          if (typeof this.startString === 'object') {
      Severity: Minor
      Found in src/lib/base/GenerateBuilder.ts - About 35 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 setStatus has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      function setStatus (filePath, status) {
        let fileData
        try {
          fileData = fs.readFileSync(filePath, 'utf8')
        } catch (error) {
      Severity: Minor
      Found in src/lib/StatusHelper.ts - 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