matteozambon89/trailpack-swagger

View on GitHub
api/services/SwaggerService.js

Summary

Maintainability
F
2 wks
Test Coverage

File SwaggerService.js has 1298 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * @Author: Matteo Zambon <Matteo>
 * @Date:   2017-04-13 06:55:18
 * @Last modified by:   Matteo
 * @Last modified time: 2017-07-30 01:06:47
Severity: Major
Found in api/services/SwaggerService.js - About 3 days to fix

    Function getPathModelByIdAndRelation has 146 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      getPathModelByIdAndRelation(paths, config, doc, modelName, modelRelation) {
        const pathItem = {}
        const pathId = standardBasePath +
                        '/' +
                        modelName.toLowerCase() +
    Severity: Major
    Found in api/services/SwaggerService.js - About 5 hrs to fix

      Function getBasePath has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
      Open

        getBasePath(config) {
          if (config.swagger.basePath) {
            return config.swagger.basePath
          }
          else if (config.footprints && config.footprints.prefix) {
      Severity: Minor
      Found in api/services/SwaggerService.js - About 5 hrs 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

      exports has 40 functions (exceeds 20 allowed). Consider refactoring.
      Open

      module.exports = class SwaggerService extends Service {
      
      // Example
      
        extractExampleDirective (propertyExample) {
      Severity: Minor
      Found in api/services/SwaggerService.js - About 5 hrs to fix

        Function getPathModelByIdAndRelationById has 120 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          getPathModelByIdAndRelationById(paths, config, doc, modelName, modelRelation) {
            const pathItem = {}
            const pathId = standardBasePath +
                            '/' +
                            modelName.toLowerCase() +
        Severity: Major
        Found in api/services/SwaggerService.js - About 4 hrs to fix

          Function genPropertyExample has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

            genPropertyExample (propertyExample, modelExample, withRel) {
              let example = null
          
              if (typeof propertyExample === 'string') {
                const directive = this.extractExampleDirective(propertyExample)
          Severity: Minor
          Found in api/services/SwaggerService.js - About 3 hrs 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 getResponses has 90 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            getResponses(config, doc) {
              const responses = {}
          
              responses['x-GenericSuccess'] = {
                description: 'Generic Successful Response',
          Severity: Major
          Found in api/services/SwaggerService.js - About 3 hrs to fix

            Function getPathModel has 88 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              getPathModel(paths, config, doc, modelName) {
                const pathItem = {}
                const pathId = standardBasePath + '/' + modelName.toLowerCase()
            
                pathItem.get = {}
            Severity: Major
            Found in api/services/SwaggerService.js - About 3 hrs to fix

              Function getDefinitionModel has 77 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                getDefinitionModel(config, doc, models, modelName) {
                  modelRelations[modelName] = []
                  modelPopulates[modelName] = []
              
                  // Get Models
              Severity: Major
              Found in api/services/SwaggerService.js - About 3 hrs to fix

                Function getPathModelById has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  getPathModelById(paths, config, doc, modelName) {
                    const pathItem = {}
                    const pathId = standardBasePath + '/' + modelName.toLowerCase() + '/{id}'
                
                    pathItem.get = {}
                Severity: Major
                Found in api/services/SwaggerService.js - About 2 hrs to fix

                  Function getDefinitionModel has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                  Open

                    getDefinitionModel(config, doc, models, modelName) {
                      modelRelations[modelName] = []
                      modelPopulates[modelName] = []
                  
                      // Get Models
                  Severity: Minor
                  Found in api/services/SwaggerService.js - About 2 hrs 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 55 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    genResponseObject(httpCode, responseName, description) {
                      const responseObject = {}
                  
                      switch (httpCode) {
                      case '200':
                  Severity: Major
                  Found in api/services/SwaggerService.js - About 2 hrs to fix

                    Function getDefinitions has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      getDefinitions(config, doc) {
                        const definitions = {}
                    
                        definitions['x-any'] = {
                          'properties': {}
                    Severity: Major
                    Found in api/services/SwaggerService.js - About 2 hrs to fix

                      Function parseDefinitionModelProperty has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        parseDefinitionModelProperty(property) {
                          property.type = property.type.toLowerCase()
                      
                          if (property.type === 'integer') {
                            property.type = 'integer'
                      Severity: Minor
                      Found in api/services/SwaggerService.js - About 2 hrs to fix

                        Function genPropertyExample has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          genPropertyExample (propertyExample, modelExample, withRel) {
                            let example = null
                        
                            if (typeof propertyExample === 'string') {
                              const directive = this.extractExampleDirective(propertyExample)
                        Severity: Minor
                        Found in api/services/SwaggerService.js - About 1 hr to fix

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

                            getBasePath(config) {
                              if (config.swagger.basePath) {
                                return config.swagger.basePath
                              }
                              else if (config.footprints && config.footprints.prefix) {
                          Severity: Minor
                          Found in api/services/SwaggerService.js - About 1 hr to fix

                            Function parseDefinitionModelProperty has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                            Open

                              parseDefinitionModelProperty(property) {
                                property.type = property.type.toLowerCase()
                            
                                if (property.type === 'integer') {
                                  property.type = 'integer'
                            Severity: Minor
                            Found in api/services/SwaggerService.js - About 1 hr 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 getModelCriteria has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              getModelCriteria(config, doc, modelName, keepId) {
                                const definition = doc.definitions[modelName]
                            
                                const criterias = []
                            
                            
                            Severity: Minor
                            Found in api/services/SwaggerService.js - About 1 hr to fix

                              Function getPathLocalRegister has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                getPathLocalRegister(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

                                Function getModelCriteria has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  getModelCriteria(config, doc, modelName, keepId) {
                                    const definition = doc.definitions[modelName]
                                
                                    const criterias = []
                                
                                
                                Severity: Minor
                                Found in api/services/SwaggerService.js - About 1 hr 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 getDefinitions has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  getDefinitions(config, doc) {
                                    const definitions = {}
                                
                                    definitions['x-any'] = {
                                      'properties': {}
                                Severity: Minor
                                Found in api/services/SwaggerService.js - About 1 hr 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 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

                                  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

                                    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

                                    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

                                    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

                                      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

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

                                            else if (property.collection && property.through) {
                                              const throughFilter = this.getModelNameFromModelMap(property.through)
                                      
                                              prop['type'] = 'array'
                                              prop['items'] = {
                                      Severity: Major
                                      Found in api/services/SwaggerService.js and 1 other location - About 4 hrs to fix
                                      api/services/SwaggerService.js on lines 495..554

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

                                      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 (property.collection && !property.through) {
                                              const collectionFilter = this.getModelNameFromModelMap(property.collection)
                                      
                                              prop['type'] = 'array'
                                              prop['items'] = {
                                      Severity: Major
                                      Found in api/services/SwaggerService.js and 1 other location - About 4 hrs to fix
                                      api/services/SwaggerService.js on lines 514..554

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

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

                                          pathItem.put.parameters.push({
                                            name: 'data',
                                            in: 'body',
                                            description: 'Data to update a ' + inflect.titleize(modelRelation.property),
                                            required: true,
                                      Severity: Major
                                      Found in api/services/SwaggerService.js and 2 other locations - About 3 hrs to fix
                                      api/services/SwaggerService.js on lines 1339..1348
                                      api/services/SwaggerService.js on lines 1372..1381

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

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

                                          pathItem.put.parameters.push({
                                            name: 'data',
                                            in: 'body',
                                            description: 'Data to update a ' + inflect.titleize(modelRelation.property),
                                            required: true,
                                      Severity: Major
                                      Found in api/services/SwaggerService.js and 2 other locations - About 3 hrs to fix
                                      api/services/SwaggerService.js on lines 1339..1348
                                      api/services/SwaggerService.js on lines 1490..1499

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

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

                                          pathItem.post.parameters.push({
                                            name: 'data',
                                            in: 'body',
                                            description: 'Data to create a new ' + inflect.titleize(modelRelation.property),
                                            required: true,
                                      Severity: Major
                                      Found in api/services/SwaggerService.js and 2 other locations - About 3 hrs to fix
                                      api/services/SwaggerService.js on lines 1372..1381
                                      api/services/SwaggerService.js on lines 1490..1499

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

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

                                          pathItem.put.parameters.push({
                                            name: 'data',
                                            in: 'body',
                                            description: 'Data to update a ' + inflect.titleize(modelName),
                                            required: true,
                                      Severity: Major
                                      Found in api/services/SwaggerService.js and 2 other locations - About 2 hrs to fix
                                      api/services/SwaggerService.js on lines 1132..1141
                                      api/services/SwaggerService.js on lines 1152..1161

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

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

                                          pathItem.post.parameters.push({
                                            name: 'data',
                                            in: 'body',
                                            description: 'Data to create a new ' + inflect.titleize(modelName),
                                            required: true,
                                      Severity: Major
                                      Found in api/services/SwaggerService.js and 2 other locations - About 2 hrs to fix
                                      api/services/SwaggerService.js on lines 1152..1161
                                      api/services/SwaggerService.js on lines 1224..1233

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

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

                                          pathItem.put.parameters.push({
                                            name: 'data',
                                            in: 'body',
                                            description: 'Data to create a new ' + inflect.titleize(modelName),
                                            required: true,
                                      Severity: Major
                                      Found in api/services/SwaggerService.js and 2 other locations - About 2 hrs to fix
                                      api/services/SwaggerService.js on lines 1132..1141
                                      api/services/SwaggerService.js on lines 1224..1233

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

                                      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: 'populate',
                                            in: 'query',
                                            description: 'Properties to populate (valid: ' + modelPopulates[modelName].join(', ') + ')',
                                            required: false,
                                      Severity: Major
                                      Found in api/services/SwaggerService.js and 1 other location - About 2 hrs to fix
                                      api/services/SwaggerService.js on lines 1094..1103

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

                                      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: 'populate',
                                            in: 'query',
                                            description: 'Properties to populate (check populate for ' +
                                                          inflect.titleize(modelRelation.model) +
                                      Severity: Major
                                      Found in api/services/SwaggerService.js and 1 other location - About 2 hrs to fix
                                      api/services/SwaggerService.js on lines 1286..1297

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

                                      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: 'populate',
                                            in: 'query',
                                            description: 'Properties to populate (valid: ' + modelPopulates[modelName].join(', ') + ')',
                                            required: false,
                                      Severity: Major
                                      Found in api/services/SwaggerService.js and 1 other location - About 2 hrs to fix
                                      api/services/SwaggerService.js on lines 1197..1206

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

                                      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: 'populate',
                                            in: 'query',
                                            description: 'Properties to populate (check populate for ' +
                                                          inflect.titleize(modelRelation.model) +
                                      Severity: Major
                                      Found in api/services/SwaggerService.js and 1 other location - About 2 hrs to fix
                                      api/services/SwaggerService.js on lines 1448..1459

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

                                      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: 'limit',
                                            in: 'query',
                                            description: 'Pagination size',
                                            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 1298..1306

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

                                      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: 'limit',
                                            in: 'query',
                                            description: 'Pagination size',
                                            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 1104..1112

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

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

                                          pathItem.get.parameters.push({
                                            name: 'cid',
                                            in: 'path',
                                            description: inflect.titleize(modelRelation.property) + ' id',
                                            required: true,
                                      Severity: Major
                                      Found in api/services/SwaggerService.js and 2 other locations - About 1 hr to fix
                                      api/services/SwaggerService.js on lines 1483..1489
                                      api/services/SwaggerService.js on lines 1525..1531

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

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

                                          pathItem.put.parameters.push({
                                            name: 'cid',
                                            in: 'path',
                                            description: inflect.titleize(modelRelation.property) + ' id',
                                            required: true,
                                      Severity: Major
                                      Found in api/services/SwaggerService.js and 2 other locations - About 1 hr to fix
                                      api/services/SwaggerService.js on lines 1441..1447
                                      api/services/SwaggerService.js on lines 1525..1531

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

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

                                          pathItem.delete.parameters.push({
                                            name: 'cid',
                                            in: 'path',
                                            description: inflect.titleize(modelRelation.model) + ' id',
                                            required: true,
                                      Severity: Major
                                      Found in api/services/SwaggerService.js and 2 other locations - About 1 hr to fix
                                      api/services/SwaggerService.js on lines 1441..1447
                                      api/services/SwaggerService.js on lines 1483..1489

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

                                      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.get.summary = 'List all ' +
                                                                  inflect.titleize(inflect.pluralize(modelRelation.property)) +
                                                                  ' on ' +
                                                                  inflect.titleize(modelRelation.model)
                                      Severity: Major
                                      Found in api/services/SwaggerService.js and 1 other location - About 1 hr to fix
                                      api/services/SwaggerService.js on lines 1320..1323

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

                                      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.summary = 'Create a ' +
                                                                  inflect.titleize(inflect.pluralize(modelRelation.property)) +
                                                                  ' on ' +
                                                                  inflect.titleize(modelRelation.model)
                                      Severity: Major
                                      Found in api/services/SwaggerService.js and 1 other location - About 1 hr to fix
                                      api/services/SwaggerService.js on lines 1267..1270

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

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

                                      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

                                      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

                                      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

                                      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

                                      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

                                      There are no issues that match your filters.

                                      Category
                                      Status