matteozambon89/trailpack-swagger

View on GitHub

Showing 79 of 79 total issues

Similar blocks of code found in 7 locations. Consider refactoring.
Open

    if (modelName.toLowerCase() !== modelRelation.model.toLowerCase()) {
      pathItem.get.tags.push(modelRelation.model)
    }
Severity: Major
Found in api/services/SwaggerService.js and 6 other locations - About 50 mins to fix
api/services/SwaggerService.js on lines 1328..1330
api/services/SwaggerService.js on lines 1361..1363
api/services/SwaggerService.js on lines 1394..1396
api/services/SwaggerService.js on lines 1430..1432
api/services/SwaggerService.js on lines 1472..1474
api/services/SwaggerService.js on lines 1514..1516

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 52.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 7 locations. Consider refactoring.
Open

    if (modelName.toLowerCase() !== modelRelation.model.toLowerCase()) {
      pathItem.post.tags.push(modelRelation.model)
    }
Severity: Major
Found in api/services/SwaggerService.js and 6 other locations - About 50 mins to fix
api/services/SwaggerService.js on lines 1275..1277
api/services/SwaggerService.js on lines 1361..1363
api/services/SwaggerService.js on lines 1394..1396
api/services/SwaggerService.js on lines 1430..1432
api/services/SwaggerService.js on lines 1472..1474
api/services/SwaggerService.js on lines 1514..1516

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 52.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 7 locations. Consider refactoring.
Open

    if (modelName.toLowerCase() !== modelRelation.model.toLowerCase()) {
      pathItem.delete.tags.push(modelRelation.model)
    }
Severity: Major
Found in api/services/SwaggerService.js and 6 other locations - About 50 mins to fix
api/services/SwaggerService.js on lines 1275..1277
api/services/SwaggerService.js on lines 1328..1330
api/services/SwaggerService.js on lines 1361..1363
api/services/SwaggerService.js on lines 1430..1432
api/services/SwaggerService.js on lines 1472..1474
api/services/SwaggerService.js on lines 1514..1516

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 52.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 7 locations. Consider refactoring.
Open

    if (modelName.toLowerCase() !== modelRelation.model.toLowerCase()) {
      pathItem.get.tags.push(modelRelation.model)
    }
Severity: Major
Found in api/services/SwaggerService.js and 6 other locations - About 50 mins to fix
api/services/SwaggerService.js on lines 1275..1277
api/services/SwaggerService.js on lines 1328..1330
api/services/SwaggerService.js on lines 1361..1363
api/services/SwaggerService.js on lines 1394..1396
api/services/SwaggerService.js on lines 1472..1474
api/services/SwaggerService.js on lines 1514..1516

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 52.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    case '401':
      responseObject.description = description || 'Unauthorized'
      responseObject.schema = {
        type: 'object',
        '$ref': '#/definitions/' + (responseName || 'Unauthorized')
Severity: Major
Found in api/services/SwaggerService.js and 3 other locations - About 45 mins to fix
api/services/SwaggerService.js on lines 697..703
api/services/SwaggerService.js on lines 711..717
api/services/SwaggerService.js on lines 718..724

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 50.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    case '400':
      responseObject.description = description || 'Bad Request'
      responseObject.schema = {
        type: 'object',
        '$ref': '#/definitions/' + (responseName || 'BadRequest')
Severity: Major
Found in api/services/SwaggerService.js and 3 other locations - About 45 mins to fix
api/services/SwaggerService.js on lines 704..710
api/services/SwaggerService.js on lines 711..717
api/services/SwaggerService.js on lines 718..724

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 50.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    case '404':
      responseObject.description = description || 'Not Found'
      responseObject.schema = {
        type: 'object',
        '$ref': '#/definitions/' + (responseName || 'NotFound')
Severity: Major
Found in api/services/SwaggerService.js and 3 other locations - About 45 mins to fix
api/services/SwaggerService.js on lines 697..703
api/services/SwaggerService.js on lines 704..710
api/services/SwaggerService.js on lines 718..724

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 50.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function extractExampleDirective has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  extractExampleDirective (propertyExample) {
    const directive = {}

    // Clean Example
    let propertyExampleClean = propertyExample.replace(/^{{|}}$/g, '')
Severity: Minor
Found in api/services/SwaggerService.js - About 45 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

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    case '500':
      responseObject.description = description || 'Unexpected Error'
      responseObject.schema = {
        type: 'object',
        '$ref': '#/definitions/' + (responseName || 'UnexpectedError')
Severity: Major
Found in api/services/SwaggerService.js and 3 other locations - About 45 mins to fix
api/services/SwaggerService.js on lines 697..703
api/services/SwaggerService.js on lines 704..710
api/services/SwaggerService.js on lines 711..717

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 50.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Avoid deeply nested control flow statements.
Open

            if (path1[p] === path2[p]) {
              basePath.push(path1[p])
            }
            else {
              break
Severity: Major
Found in api/services/SwaggerService.js - About 45 mins to fix

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        if (!_.includes(_.keys(this.app.packs), 'waterline')) {
          return Promise.reject(new Error('This Trailpack only works for waterline!'))
        }
    Severity: Minor
    Found in index.js and 1 other location - About 40 mins to fix
    index.js on lines 13..15

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 49.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        if (!_.includes(_.keys(this.app.packs), 'express')) {
          return Promise.reject(new Error('This Trailpack only works for express!'))
        }
    Severity: Minor
    Found in index.js and 1 other location - About 40 mins to fix
    index.js on lines 17..19

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 49.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Open

        pathItem.delete.summary = 'Destroy a ' +
                                  inflect.titleize(modelRelation.property) +
                                  ' on ' +
                                  inflect.titleize(modelName)
    Severity: Major
    Found in api/services/SwaggerService.js and 4 other locations - About 35 mins to fix
    api/services/SwaggerService.js on lines 1353..1356
    api/services/SwaggerService.js on lines 1422..1425
    api/services/SwaggerService.js on lines 1464..1467
    api/services/SwaggerService.js on lines 1504..1507

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 47.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Open

        pathItem.delete.summary = 'Destroy a ' +
                                  inflect.titleize(modelRelation.property) +
                                  ' on ' +
                                  inflect.titleize(modelName)
    Severity: Major
    Found in api/services/SwaggerService.js and 4 other locations - About 35 mins to fix
    api/services/SwaggerService.js on lines 1353..1356
    api/services/SwaggerService.js on lines 1386..1389
    api/services/SwaggerService.js on lines 1422..1425
    api/services/SwaggerService.js on lines 1464..1467

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 47.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Open

        pathItem.put.summary = 'Update a ' +
                                inflect.titleize(modelRelation.property) +
                                ' on ' +
                                inflect.titleize(modelName)
    Severity: Major
    Found in api/services/SwaggerService.js and 4 other locations - About 35 mins to fix
    api/services/SwaggerService.js on lines 1386..1389
    api/services/SwaggerService.js on lines 1422..1425
    api/services/SwaggerService.js on lines 1464..1467
    api/services/SwaggerService.js on lines 1504..1507

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 47.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Open

        pathItem.put.summary = 'Update a ' +
                                inflect.titleize(modelRelation.property) +
                                ' on ' +
                                inflect.titleize(modelName)
    Severity: Major
    Found in api/services/SwaggerService.js and 4 other locations - About 35 mins to fix
    api/services/SwaggerService.js on lines 1353..1356
    api/services/SwaggerService.js on lines 1386..1389
    api/services/SwaggerService.js on lines 1422..1425
    api/services/SwaggerService.js on lines 1504..1507

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 47.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Open

        pathItem.get.summary = 'Get a ' +
                                inflect.titleize(modelRelation.property) +
                                ' on ' +
                                inflect.titleize(modelName)
    Severity: Major
    Found in api/services/SwaggerService.js and 4 other locations - About 35 mins to fix
    api/services/SwaggerService.js on lines 1353..1356
    api/services/SwaggerService.js on lines 1386..1389
    api/services/SwaggerService.js on lines 1464..1467
    api/services/SwaggerService.js on lines 1504..1507

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 47.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

      getResponses(config, doc) {
        const responses = {}
    
        responses['x-GenericSuccess'] = {
          description: 'Generic Successful Response',
    Severity: Minor
    Found in api/services/SwaggerService.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

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

      genResponseObject(httpCode, responseName, description) {
        const responseObject = {}
    
        switch (httpCode) {
        case '200':
    Severity: Minor
    Found in api/services/SwaggerService.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