matteozambon89/trailpack-swagger

View on GitHub

Showing 79 of 79 total issues

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

  getPathLocalLogin(paths, config) {
    const pathItem = {}

    const localStrategy = config.passport.strategies.local
    let usernameField = 'username'
Severity: Minor
Found in api/services/SwaggerService.js - About 1 hr to fix

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

        pathItem.put.parameters.push({
          name: 'id',
          in: 'path',
          description: inflect.titleize(modelName) + ' id',
          required: true,
    Severity: Major
    Found in api/services/SwaggerService.js and 9 other locations - About 1 hr to fix
    api/services/SwaggerService.js on lines 1190..1196
    api/services/SwaggerService.js on lines 1217..1223
    api/services/SwaggerService.js on lines 1244..1250
    api/services/SwaggerService.js on lines 1279..1285
    api/services/SwaggerService.js on lines 1332..1338
    api/services/SwaggerService.js on lines 1365..1371
    api/services/SwaggerService.js on lines 1398..1404
    api/services/SwaggerService.js on lines 1434..1440
    api/services/SwaggerService.js on lines 1518..1524

    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 57.

    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 10 locations. Consider refactoring.
    Open

        pathItem.post.parameters.push({
          name: 'id',
          in: 'path',
          description: inflect.titleize(modelName) + ' id',
          required: true,
    Severity: Major
    Found in api/services/SwaggerService.js and 9 other locations - About 1 hr to fix
    api/services/SwaggerService.js on lines 1190..1196
    api/services/SwaggerService.js on lines 1217..1223
    api/services/SwaggerService.js on lines 1244..1250
    api/services/SwaggerService.js on lines 1279..1285
    api/services/SwaggerService.js on lines 1365..1371
    api/services/SwaggerService.js on lines 1398..1404
    api/services/SwaggerService.js on lines 1434..1440
    api/services/SwaggerService.js on lines 1476..1482
    api/services/SwaggerService.js on lines 1518..1524

    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 57.

    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 10 locations. Consider refactoring.
    Open

        pathItem.delete.parameters.push({
          name: 'id',
          in: 'path',
          description: inflect.titleize(modelName) + ' id',
          required: true,
    Severity: Major
    Found in api/services/SwaggerService.js and 9 other locations - About 1 hr to fix
    api/services/SwaggerService.js on lines 1190..1196
    api/services/SwaggerService.js on lines 1217..1223
    api/services/SwaggerService.js on lines 1244..1250
    api/services/SwaggerService.js on lines 1279..1285
    api/services/SwaggerService.js on lines 1332..1338
    api/services/SwaggerService.js on lines 1365..1371
    api/services/SwaggerService.js on lines 1434..1440
    api/services/SwaggerService.js on lines 1476..1482
    api/services/SwaggerService.js on lines 1518..1524

    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 57.

    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 10 locations. Consider refactoring.
    Open

        pathItem.get.parameters.push({
          name: 'id',
          in: 'path',
          description: inflect.titleize(modelName) + ' id',
          required: true,
    Severity: Major
    Found in api/services/SwaggerService.js and 9 other locations - About 1 hr to fix
    api/services/SwaggerService.js on lines 1190..1196
    api/services/SwaggerService.js on lines 1217..1223
    api/services/SwaggerService.js on lines 1244..1250
    api/services/SwaggerService.js on lines 1332..1338
    api/services/SwaggerService.js on lines 1365..1371
    api/services/SwaggerService.js on lines 1398..1404
    api/services/SwaggerService.js on lines 1434..1440
    api/services/SwaggerService.js on lines 1476..1482
    api/services/SwaggerService.js on lines 1518..1524

    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 57.

    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 10 locations. Consider refactoring.
    Open

        pathItem.get.parameters.push({
          name: 'id',
          in: 'path',
          description: inflect.titleize(modelName) + ' id',
          required: true,
    Severity: Major
    Found in api/services/SwaggerService.js and 9 other locations - About 1 hr to fix
    api/services/SwaggerService.js on lines 1217..1223
    api/services/SwaggerService.js on lines 1244..1250
    api/services/SwaggerService.js on lines 1279..1285
    api/services/SwaggerService.js on lines 1332..1338
    api/services/SwaggerService.js on lines 1365..1371
    api/services/SwaggerService.js on lines 1398..1404
    api/services/SwaggerService.js on lines 1434..1440
    api/services/SwaggerService.js on lines 1476..1482
    api/services/SwaggerService.js on lines 1518..1524

    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 57.

    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 10 locations. Consider refactoring.
    Open

        pathItem.delete.parameters.push({
          name: 'id',
          in: 'path',
          description: inflect.titleize(modelName) + ' id',
          required: true,
    Severity: Major
    Found in api/services/SwaggerService.js and 9 other locations - About 1 hr to fix
    api/services/SwaggerService.js on lines 1190..1196
    api/services/SwaggerService.js on lines 1217..1223
    api/services/SwaggerService.js on lines 1244..1250
    api/services/SwaggerService.js on lines 1279..1285
    api/services/SwaggerService.js on lines 1332..1338
    api/services/SwaggerService.js on lines 1365..1371
    api/services/SwaggerService.js on lines 1398..1404
    api/services/SwaggerService.js on lines 1434..1440
    api/services/SwaggerService.js on lines 1476..1482

    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 57.

    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 10 locations. Consider refactoring.
    Open

        pathItem.put.parameters.push({
          name: 'id',
          in: 'path',
          description: inflect.titleize(modelName) + ' id',
          required: true,
    Severity: Major
    Found in api/services/SwaggerService.js and 9 other locations - About 1 hr to fix
    api/services/SwaggerService.js on lines 1190..1196
    api/services/SwaggerService.js on lines 1217..1223
    api/services/SwaggerService.js on lines 1244..1250
    api/services/SwaggerService.js on lines 1279..1285
    api/services/SwaggerService.js on lines 1332..1338
    api/services/SwaggerService.js on lines 1398..1404
    api/services/SwaggerService.js on lines 1434..1440
    api/services/SwaggerService.js on lines 1476..1482
    api/services/SwaggerService.js on lines 1518..1524

    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 57.

    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 10 locations. Consider refactoring.
    Open

        pathItem.get.parameters.push({
          name: 'id',
          in: 'path',
          description: inflect.titleize(modelName) + ' id',
          required: true,
    Severity: Major
    Found in api/services/SwaggerService.js and 9 other locations - About 1 hr to fix
    api/services/SwaggerService.js on lines 1190..1196
    api/services/SwaggerService.js on lines 1217..1223
    api/services/SwaggerService.js on lines 1244..1250
    api/services/SwaggerService.js on lines 1279..1285
    api/services/SwaggerService.js on lines 1332..1338
    api/services/SwaggerService.js on lines 1365..1371
    api/services/SwaggerService.js on lines 1398..1404
    api/services/SwaggerService.js on lines 1476..1482
    api/services/SwaggerService.js on lines 1518..1524

    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 57.

    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 10 locations. Consider refactoring.
    Open

        pathItem.put.parameters.push({
          name: 'id',
          in: 'path',
          description: inflect.titleize(modelName) + ' id',
          required: true,
    Severity: Major
    Found in api/services/SwaggerService.js and 9 other locations - About 1 hr to fix
    api/services/SwaggerService.js on lines 1190..1196
    api/services/SwaggerService.js on lines 1244..1250
    api/services/SwaggerService.js on lines 1279..1285
    api/services/SwaggerService.js on lines 1332..1338
    api/services/SwaggerService.js on lines 1365..1371
    api/services/SwaggerService.js on lines 1398..1404
    api/services/SwaggerService.js on lines 1434..1440
    api/services/SwaggerService.js on lines 1476..1482
    api/services/SwaggerService.js on lines 1518..1524

    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 57.

    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 10 locations. Consider refactoring.
    Open

        pathItem.delete.parameters.push({
          name: 'id',
          in: 'path',
          description: inflect.titleize(modelName) + ' id',
          required: true,
    Severity: Major
    Found in api/services/SwaggerService.js and 9 other locations - About 1 hr to fix
    api/services/SwaggerService.js on lines 1190..1196
    api/services/SwaggerService.js on lines 1217..1223
    api/services/SwaggerService.js on lines 1279..1285
    api/services/SwaggerService.js on lines 1332..1338
    api/services/SwaggerService.js on lines 1365..1371
    api/services/SwaggerService.js on lines 1398..1404
    api/services/SwaggerService.js on lines 1434..1440
    api/services/SwaggerService.js on lines 1476..1482
    api/services/SwaggerService.js on lines 1518..1524

    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 57.

    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 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      extractExampleDirective (propertyExample) {
        const directive = {}
    
        // Clean Example
        let propertyExampleClean = propertyExample.replace(/^{{|}}$/g, '')
    Severity: Minor
    Found in api/services/SwaggerService.js - About 1 hr to fix

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

          pathItem.get.parameters.push({
            name: 'offset',
            in: 'query',
            description: 'Pagination cusrsor',
            required: false,
      Severity: Major
      Found in api/services/SwaggerService.js and 1 other location - About 1 hr to fix
      api/services/SwaggerService.js on lines 1307..1315

      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 55.

      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

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

          pathItem.get.parameters.push({
            name: 'offset',
            in: 'query',
            description: 'Pagination cusrsor',
            required: false,
      Severity: Major
      Found in api/services/SwaggerService.js and 1 other location - About 1 hr to fix
      api/services/SwaggerService.js on lines 1113..1121

      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 55.

      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

          pathItem.post.parameters = [
            {
              name: 'data',
              in: 'body',
              description: 'Data to register a new User (password field is required)',
      Severity: Minor
      Found in api/services/SwaggerService.js and 1 other location - About 55 mins to fix
      api/services/SwaggerService.js on lines 955..966

      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 54.

      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

          pathItem.post.parameters = [
            {
              name: 'data',
              in: 'body',
              description: 'Login credentials',
      Severity: Minor
      Found in api/services/SwaggerService.js and 1 other location - About 55 mins to fix
      api/services/SwaggerService.js on lines 916..927

      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 54.

      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 getPaths has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

        getPaths(config, doc) {
          let paths = {}
      
          if (config.passport && config.passport.strategies) {
            for (const authType in config.passport.strategies) {
      Severity: Minor
      Found in api/services/SwaggerService.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

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

          if (modelName.toLowerCase() !== modelRelation.model.toLowerCase()) {
            pathItem.put.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 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 1394..1396
      api/services/SwaggerService.js on lines 1430..1432
      api/services/SwaggerService.js on lines 1472..1474

      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.put.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 1430..1432
      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

      Severity
      Category
      Status
      Source
      Language