wyvern8/akamai-nginx

View on GitHub

Showing 10 of 28 total issues

Function setVariableLua has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    setVariableLua(options) {

        let lua = ['local result'];

        if (options.valueSource === 'EXPRESSION') {
Severity: Minor
Found in src/behaviors/setVariable.js - About 1 hr to fix

    Function process has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        process() {
    
            let expires = this.expires();
    
            let lua = this.switchByVal({
    Severity: Minor
    Found in src/behaviors/downstreamCache.js - About 1 hr to fix

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

          process() {
      
              let result = '\n' + this.pad(this.depth) + '-- ' + this.name + ' rule ####';
              let criteriaNames = this.criteriaNames(this.criteria) ? this.criteriaNames(this.criteria) : 'none';
              result += '\n'  + this.pad(this.depth) + '-- criteria: ' + criteriaNames;
      Severity: Minor
      Found in src/rule.js - About 1 hr to fix

        Function processHeaderOptions has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            processHeaderOptions(luaMapName, comment, capture) {
                let headerName = this.switchByVal({
                    'MODIFY': this.getHeaderName('standardModifyHeaderName'),
                    'ADD': this.getHeaderName('standardAddHeaderName'),
                    'REMOVE': this.getHeaderName('standardRemoveHeaderName'),
        Severity: Minor
        Found in src/behavior.js - About 1 hr to fix

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

              constructor(options, valueMap) {
                  super();
                  this.options = options;
                  this.valueMap = valueMap;
          
          
          Severity: Minor
          Found in src/criteria/matchVariable.js - About 1 hr to fix

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

                process(usePattern, valueSuffix) {
            
                    if (['EXISTS', 'IS_NOT_EMPTY', 'DOES_NOT_EXIST', 'IS_EMPTY'].includes(this.options.matchOperator)) {
            
                        return this.checkVar + this.matchOperatorCompare() + 'nil' +
            Severity: Minor
            Found in src/criteria.js - About 1 hr to fix

              Function setApiConfig has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              export function setApiConfig(edgegrid, contractId, groupId, propertyId, propertyVersion, outputFile) {
              Severity: Minor
              Found in src/akamai-nginx.js - About 45 mins to fix

                Function papiChoice has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    async function papiChoice(message, papiUrl, containerField, valueField, nameField) {
                Severity: Minor
                Found in configure.js - About 35 mins to fix

                  Function constructor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      constructor(options, valueMap) {
                          super();
                          this.options = options;
                          this.valueMap = valueMap;
                  
                  
                  Severity: Minor
                  Found in src/criteria/matchVariable.js - 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

                  Function process has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      process() {
                  
                          let result = '\n' + this.pad(this.depth) + '-- ' + this.name + ' rule ####';
                          let criteriaNames = this.criteriaNames(this.criteria) ? this.criteriaNames(this.criteria) : 'none';
                          result += '\n'  + this.pad(this.depth) + '-- criteria: ' + criteriaNames;
                  Severity: Minor
                  Found in src/rule.js - 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