Showing 112 of 206 total issues
Function validate2And3PathParameterDeclarationHasMatchingDefiniton
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const validate2And3PathParameterDeclarationHasMatchingDefiniton = () => async system => {
const nodes = await system.validateSelectors.allPathItems()
return nodes.reduce(async (prev, node) => {
const acc = await prev
Function validate2And3PathParameterIsDefinedInPath
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const validate2And3PathParameterIsDefinedInPath = () => (system) => {
const refArray = []
return system.validateSelectors
.allParameters()
.then(nodes => {
Function validate2And3MinAndMax
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const validate2And3MinAndMax = () => (system) => {
return system.validateSelectors
.allSchemas()
.then(nodes => {
return nodes.reduce((acc, node) => {
Function validateOAS3RefsForRequestBodiesReferenceRequestBodyPositions
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const validateOAS3RefsForRequestBodiesReferenceRequestBodyPositions = () => sys => {
return sys.validateSelectors
.allOAS3RequestBodies()
.then(nodes => {
return nodes.reduce((acc, node) => {
Function spec
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function spec() {
return {
statePlugins: {
spec: {
selectors: {
Function validateOAS3HeaderParameterNames
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const validateOAS3HeaderParameterNames = () => (system) => {
return system.validateSelectors
.allParameters()
.then(nodes => {
return nodes.reduce((acc, node) => {
- Read upRead up
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 getChild
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function getChild(object, key) {
var keys = Object.keys(object)
var regex
var isArrayAccess = /^\d+$/.test(key)
- Read upRead up
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 getChild
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function getChild(object, key) {
var keys = Object.keys(object)
var regex
var isArrayAccess = /^\d+$/.test(key)
- Read upRead up
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 mergeParams
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function mergeParams(objA = {}, objB = {}) {
if (!objA && !objB) {
return undefined
}
- Read upRead up
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 find
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function find(current, path, last) {
if(!current) {
// something has gone quite wrong
// return the last start_mark as a best-effort
if(last && last.start_mark)
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")
Function default
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function() {
return {
afterLoad: system => system.jsonSchemaValidatorActions.setup(),
statePlugins: {
jsonSchemaValidator: {
Function getSchemaBasePath
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const getSchemaBasePath = () => ({ specSelectors }) => {
// Eg: [openapi-3.0] or [openapi-2-0]
// later on... ["openapi-2.0", "paths", "get"]
const isOAS3 = specSelectors.isOAS3 ? specSelectors.isOAS3() : false
const isSwagger2 = specSelectors.isSwagger2
- Read upRead up
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 default
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function () {
return {
statePlugins: {
topbar: {
actions: {
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { menuAlign, align, inverse, size, className } = this.props
const menuClassName = classnames(
"dd-menu",
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let { specSelectors, getComponent, errSelectors, fn, editorSelectors, configsSelectors } = this.props
let Editor = getComponent("Editor")
Function validateOAS3HeaderParameterNames
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const validateOAS3HeaderParameterNames = () => (system) => {
return system.validateSelectors
.allParameters()
.then(nodes => {
return nodes.reduce((acc, node) => {
Function EditorSpecPlugin
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function EditorSpecPlugin() {
return {
statePlugins: {
spec: {
wrapActions: {
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { onClose, getComponent, converterUrl } = this.props
if(this.state.status === "new") {
return <ConvertModalStepNew
Function validateOAS3RequestBodyRefsReferenceAllowableSchemaPositions
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const validateOAS3RequestBodyRefsReferenceAllowableSchemaPositions = () => sys => {
return sys.validateSelectors
.allOAS3RequestBodySchemas()
.then(nodes => {
return nodes.reduce((acc, node) => {
- Read upRead up
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"