swagger-api/swagger-editor

View on GitHub
src/plugins/validate-semantic/validators/helpers.js

Summary

Maintainability
A
3 hrs
Test Coverage

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

export function checkForDefinition(paramName, pathItem) {
  const pathItemParameters = pathItem.parameters
  const operationsInPathItem = (Object.keys(pathItem) || [])
    .filter(key => operationKeys.indexOf(key) > -1)
    .map(key => {
Severity: Minor
Found in src/plugins/validate-semantic/validators/helpers.js - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

      if(!res.found && operationsInPathItem.length) {
        operationsInPathItem
          .forEach(op => {
            const inThisOperation = (op.parameters || [])
              .some(param => param.name === paramName && param.in === "path")
    Severity: Critical
    Found in src/plugins/validate-semantic/validators/helpers.js - About 1 hr to fix

      There are no issues that match your filters.

      Category
      Status