jaumard/ecmas-annotations

View on GitHub

Showing 12 of 20 total issues

Function parseAnnotations has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

  parseAnnotations(className, target, comment, annotationsToFind, filePath) {

    const ss = new StringScanner(comment)

    const annotations = []
Severity: Minor
Found in lib/reader.js - About 5 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 parseSource has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

  parseSource(source) {

    const metadata = new Metadata()
    const ss = new StringScanner(source)

Severity: Minor
Found in lib/parseres5.js - About 5 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 parse has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

  parse(reader, annotationsToFind, string) {

    const tokens = this.tokenize(string)
    let fixedString = ''

Severity: Minor
Found in lib/attribute-parser.js - About 4 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 parseSource has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

  parseSource(source) {

    const metadata = new Metadata()
    const ss = new StringScanner(source)

Severity: Minor
Found in lib/parseres6.js - 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 parse has 90 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  parse(reader, annotationsToFind, string) {

    const tokens = this.tokenize(string)
    let fixedString = ''

Severity: Major
Found in lib/attribute-parser.js - About 3 hrs to fix

    Function parseSource has 76 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      parseSource(source) {
    
        const metadata = new Metadata()
        const ss = new StringScanner(source)
    
    
    Severity: Major
    Found in lib/parseres5.js - About 3 hrs to fix

      Function parseSource has 66 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        parseSource(source) {
      
          const metadata = new Metadata()
          const ss = new StringScanner(source)
      
      
      Severity: Major
      Found in lib/parseres6.js - About 2 hrs to fix

        Function parseAnnotations has 51 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          parseAnnotations(className, target, comment, annotationsToFind, filePath) {
        
            const ss = new StringScanner(comment)
        
            const annotations = []
        Severity: Major
        Found in lib/reader.js - About 2 hrs to fix

          Function parse has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            parse(path, mode) {
              if (!mode) {
                mode = Reader.ES6
              }
          
          
          Severity: Minor
          Found in lib/reader.js - About 1 hr to fix

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

              parse(path, mode) {
                if (!mode) {
                  mode = Reader.ES6
                }
            
            
            Severity: Minor
            Found in lib/reader.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

            Avoid deeply nested control flow statements.
            Open

                        if (open === close) {
                          done = true
                        }
            Severity: Major
            Found in lib/reader.js - About 45 mins to fix

              Consider simplifying this complex logical expression.
              Open

                        if ((isArray && part.trim().match(/(.*)=\[/)) ||
                          (isObject && part.trim().match(/(.*)=\{/)) ||
                          (isAnnotation && part.trim().match(/(.*)=@(.*)\(/))) {
              
                          found = true
              Severity: Major
              Found in lib/attribute-parser.js - About 40 mins to fix
                Severity
                Category
                Status
                Source
                Language