wordnik/swagger-editor

View on GitHub

Showing 206 of 206 total issues

Avoid too many return statements within this function.
Open

      return keywordMap[0].map(item => {
        return {
          name: "array",
          value: "- " + item,
          score: 300,
Severity: Major
Found in src/plugins/editor-autosuggest-keywords/get-keywords-for-path.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

          return [{
            name: "array",
            value: "- ",
            score: 300,
            meta: "array item"
    Severity: Major
    Found in src/plugins/editor-autosuggest-keywords/get-keywords-for-path.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          return []
      Severity: Major
      Found in src/plugins/editor-autosuggest-oas3-keywords/get-keywords-for-path.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            return []
        Severity: Major
        Found in src/plugins/editor-autosuggest-keywords/get-keywords-for-path.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                return current.start_mark.line
          Severity: Major
          Found in src/plugins/ast/ast.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                return []
            Severity: Major
            Found in src/plugins/editor-autosuggest-keywords/get-keywords-for-path.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                return suggestionFromSchema(keywordMap)
              Severity: Major
              Found in src/plugins/editor-autosuggest-keywords/get-keywords-for-path.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return formItem.set("hasErrors", false)
                Severity: Major
                Found in src/standalone/topbar-insert/forms/helpers/validation-helpers.js - About 30 mins to fix

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

                            if (ref.startsWith("#/components/schemas")) {
                              acc.push({
                                level: "error",
                                message: `requestBody $refs cannot point to '#/components/schemas/…', they must point to '#/components/requestBodies/…'`,
                                path: [...node.path, "$ref"]
                  Severity: Minor
                  Found in src/plugins/validate-semantic/validators/oas3/refs.js and 2 other locations - About 30 mins to fix
                  src/plugins/validate-semantic/validators/oas3/refs.js on lines 33..39
                  src/plugins/validate-semantic/validators/oas3/refs.js on lines 68..78

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

                  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

                        end: {
                          line: astValue.end_mark.line,
                          column: astValue.end_mark.column,
                          pointer: astValue.end_mark.pointer,
                        }
                  Severity: Minor
                  Found in src/plugins/ast/ast.js and 1 other location - About 30 mins to fix
                  src/plugins/ast/ast.js on lines 139..143

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

                  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

                      sys.validateSelectors.isRootParameter(node)
                      || sys.validateSelectors.isOAS3RootParameter(node)
                        || sys.validateSelectors.isPathItemParameter(node)
                  Severity: Minor
                  Found in src/plugins/validate-semantic/selectors.js and 1 other location - About 30 mins to fix
                  src/plugins/validate-semantic/selectors.js on lines 59..61

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

                  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

                      sys.validateSelectors.isOAS3RootRequestBody(node)
                        || sys.validateSelectors.isOAS3OperationRequestBody(node)
                        || sys.validateSelectors.isOAS3OperationCallbackRequestBody(node)
                  Severity: Minor
                  Found in src/plugins/validate-semantic/selectors.js and 1 other location - About 30 mins to fix
                  src/plugins/validate-semantic/selectors.js on lines 45..47

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

                  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

                      operationid:{
                        value: "",
                        name: "Operation ID",
                        description: "Unique string used to identify the operation. The id MUST be unique among all operations described in the API. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common programming naming conventions.",
                        updateForm: event => updateForm(event, path.concat(["operationid"]))
                  src/standalone/topbar-insert/forms/form-objects/external-documentation-object.js on lines 13..18
                  src/standalone/topbar-insert/forms/form-objects/path-object.js on lines 21..26
                  src/standalone/topbar-insert/forms/form-objects/tag-object.js on lines 14..19

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 45.

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

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

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

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

                  Refactorings

                  Further Reading

                  Avoid too many return statements within this function.
                  Open

                      return keywordMap.map(constructAceCompletion.bind(null, "value"))
                  Severity: Major
                  Found in src/plugins/editor-autosuggest-keywords/get-keywords-for-path.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          return keywordMap[0].map(item => {
                            return {
                              name: "array",
                              value: "- " + item,
                              score: 300,
                    Severity: Major
                    Found in src/plugins/editor-autosuggest-oas3-keywords/get-keywords-for-path.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                            return [{
                              name: "array",
                              value: "- ",
                              score: 300,
                              meta: "array item"
                      Severity: Major
                      Found in src/plugins/editor-autosuggest-oas3-keywords/get-keywords-for-path.js - About 30 mins to fix

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

                                  if (ref.startsWith("#/components") && !ref.startsWith("#/components/requestBodies/")) {
                                    acc.push({
                                      level: "error",
                                      message: `requestBody $refs must point to a position where a requestBody can be legally placed`,
                                      path: [...node.path, "$ref"]
                        Severity: Minor
                        Found in src/plugins/validate-semantic/validators/oas3/refs.js and 2 other locations - About 30 mins to fix
                        src/plugins/validate-semantic/validators/oas3/refs.js on lines 26..39
                        src/plugins/validate-semantic/validators/oas3/refs.js on lines 68..78

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

                        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

                              start: {
                                line: astValue.start_mark.line,
                                column: astValue.start_mark.column,
                                pointer: astValue.start_mark.pointer,
                              },
                        Severity: Minor
                        Found in src/plugins/ast/ast.js and 1 other location - About 30 mins to fix
                        src/plugins/ast/ast.js on lines 144..148

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

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

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

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

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

                        Refactorings

                        Further Reading

                        Avoid too many return statements within this function.
                        Open

                            return formItem
                        Severity: Major
                        Found in src/standalone/topbar-insert/forms/helpers/validation-helpers.js - About 30 mins to fix

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

                                  if(schemaObj.type !== undefined && typeof schemaObj.type !== "string") {
                                    acc.push({
                                      message: `Schema "type" key must be a string`,
                                      path: [...node.path, "type"],
                                      level: "error",
                          Severity: Minor
                          Found in src/plugins/validate-semantic/validators/schema.js and 1 other location - About 30 mins to fix
                          src/plugins/validate-semantic/validators/schema.js on lines 50..56

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

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

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

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

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

                          Refactorings

                          Further Reading

                          Severity
                          Category
                          Status
                          Source
                          Language