sounisi5011/readme-generator

View on GitHub

Showing 7 of 7 total issues

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

    public parse(
        parser: NunjucksExtension.Parser,
        nodes: NunjucksExtension.Nodes,
        lexer: NunjucksExtension.Lexer,
    ): NunjucksExtension.ParseResult {
Severity: Minor
Found in src/template-tags/setProp.ts - About 1 day 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 200 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public parse(
        parser: NunjucksExtension.Parser,
        nodes: NunjucksExtension.Nodes,
        lexer: NunjucksExtension.Lexer,
    ): NunjucksExtension.ParseResult {
Severity: Major
Found in src/template-tags/setProp.ts - About 1 day to fix

    File setProp.ts has 371 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { inspect } from 'util';
    
    import { TemplateError as NunjucksTemplateError } from 'nunjucks/src/lib';
    
    import type { Extension as NunjucksExtension } from '../types/nunjucks-extension';
    Severity: Minor
    Found in src/template-tags/setProp.ts - About 4 hrs to fix

      Function runAssignProperties has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public runAssignProperties(_context: NunjucksExtension.Context, arg: ArgType, body?: () => unknown): string {
              const value = body ? body() : arg.value;
              for (const targetPropData of arg.targetPropList) {
                  let obj: Record<string, unknown> | undefined;
                  targetPropData.forEach((objectPathItem, index) => {
      Severity: Minor
      Found in src/template-tags/setProp.ts - About 1 hr to fix

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

            private value2node(
                nodes: NunjucksExtension.Nodes,
                value: unknown,
                lineno: number,
                colno: number,
        Severity: Minor
        Found in src/template-tags/setProp.ts - About 1 hr to fix

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

              private getObjectPath(
                  nodes: NunjucksExtension.Nodes,
                  lookupValNode: NunjucksNodes.LookupVal | NonNullable<NunjucksNodes.LookupVal['target']>,
              ): ObjectPathData<
                  | NunjucksNodes.Symbol
          Severity: Minor
          Found in src/template-tags/setProp.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 throwError has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              private throwError(
                  parser: NunjucksExtension.Parser,
                  currentMethod: Function, // eslint-disable-line @typescript-eslint/ban-types
                  message: string,
                  linenoOrError?: number | NunjucksTemplateError,
          Severity: Minor
          Found in src/template-tags/setProp.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