luke-j/switch

View on GitHub
src/syntax/NginxSyntax.js

Summary

Maintainability
F
3 days
Test Coverage

File NginxSyntax.js has 598 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * @license
 *
 * Copyright 2016- Luke Jones (https://github.com/luke-j)
 *
Severity: Major
Found in src/syntax/NginxSyntax.js - About 1 day to fix

    Function proxy has 135 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        proxy() {
            const expression = {
                expressions: []
            };
    
    
    Severity: Major
    Found in src/syntax/NginxSyntax.js - About 5 hrs to fix

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

          compress() {
              const expression = {
                  expressions: []
              };
      
      
      Severity: Major
      Found in src/syntax/NginxSyntax.js - About 2 hrs to fix

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

            fastcgi() {
                const expression = {
                    expressions: []
                };
        
        
        Severity: Major
        Found in src/syntax/NginxSyntax.js - About 2 hrs to fix

          Function caching has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              caching() {
                  const expression = {
                          expressions: []
                      },
                      minutesInOneYear = 525600;
          Severity: Minor
          Found in src/syntax/NginxSyntax.js - About 1 hr to fix

            Function headers has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                headers() {
                    const expression = {
                        expressions: []
                    };
            
            
            Severity: Minor
            Found in src/syntax/NginxSyntax.js - About 1 hr to fix

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

                  ssl() {
                      const expression = {
                          expressions: []
                      };
              
              
              Severity: Minor
              Found in src/syntax/NginxSyntax.js - About 1 hr to fix

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

                    auth() {
                        const expression = {
                            expressions: []
                        };
                
                
                Severity: Minor
                Found in src/syntax/NginxSyntax.js - About 1 hr to fix

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

                      headers() {
                          const expression = {
                              expressions: []
                          };
                  
                  
                  Severity: Minor
                  Found in src/syntax/NginxSyntax.js - 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

                  There are no issues that match your filters.

                  Category
                  Status