swagger-api/swagger-editor

View on GitHub

Showing 112 of 206 total issues

Avoid too many return statements within this function.
Open

        return find(item, path.slice(1), current.value)
Severity: Major
Found in src/plugins/ast/ast.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 keywordMap.map(constructAceCompletion.bind(null, "value"))
      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 formItem.set("hasErrors", validationResult)
        Severity: Major
        Found in src/standalone/topbar-insert/forms/helpers/validation-helpers.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return null
          Severity: Major
          Found in src/standalone/topbar-menu-edit-convert/components/convert-modal.jsx - 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-oas3-keywords/get-keywords-for-path.js - About 30 mins to fix

              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

                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

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

                  export const validateSchemaPatternHasNoZAnchors = () => (system) => {
                    return system.validateSelectors
                      .allSchemas()
                      .then(nodes => {
                        return nodes.reduce((acc, node) => {
                  Severity: Minor
                  Found in src/plugins/validate-semantic/validators/schema.js - About 25 mins to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

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

                  export const validate2And3TypesInDefaultValuesMatchesWithEnum = () => (system) => {
                    return system.validateSelectors
                      .allSchemas()
                      .then(nodes => {
                        return nodes.reduce((acc, node) => {
                  Severity: Minor
                  Found in src/plugins/validate-semantic/validators/2and3/schemas.js - About 25 mins to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

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

                  export const shouldValidate = () => (system) => {
                    // don't run validation if spec is empty
                    if(system.specSelectors.specStr().trim().length === 0) {
                      return
                    }
                  Severity: Minor
                  Found in src/plugins/validate-semantic/selectors.js - About 25 mins to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

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

                  export const checkForEmptyValue = (value) => {
                    return !value || value === null || value === "" || !/\S/.test(value) || value === [] ||
                     (List.isList(value) && value.count() === 0) ||
                     (Map.isMap(value) && !value.size) ||
                     (OrderedMap.isOrderedMap(value) && !value.size )
                  Severity: Minor
                  Found in src/standalone/topbar-insert/forms/helpers/validation-helpers.js - About 25 mins to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Severity
                  Category
                  Status
                  Source
                  Language