Showing 112 of 206 total issues
Function validate2And3ParametersHaveUniqueNameAndInCombinations
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const validate2And3ParametersHaveUniqueNameAndInCombinations = () => (system) => {
return system.validateSelectors
.allParameterArrays()
.then(nodes => {
return nodes.reduce((acc, node) => {
Function validateOAS3RequestBodyRefsReferenceAllowableSchemaPositions
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const validateOAS3RequestBodyRefsReferenceAllowableSchemaPositions = () => sys => {
return sys.validateSelectors
.allOAS3RequestBodySchemas()
.then(nodes => {
return nodes.reduce((acc, node) => {
Function default
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function(system) {
// setTimeout runs on the next tick
setTimeout(() => {
if(localStorage.getItem(CONTENT_KEY)) {
system.specActions.updateSpec(localStorage.getItem(CONTENT_KEY), "local-storage")
Function getCompletions
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
completer.getCompletions = function(editor, session, pos, prefix, callback) {
let startTime = Date.now()
try {
ori(editor, session, pos, prefix, (...args) => {
let msElapsed = Date.now() - startTime
Function validateSecurityRequirementReferenceExistingScopes
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const validateSecurityRequirementReferenceExistingScopes = () => (system) => {
const { allSecurityRequirements, allSecurityDefinitions } = system.validateSelectors
return Promise.all([allSecurityRequirements(), allSecurityDefinitions()])
.then(([requirementNodes, definitionNodes]) => {
Function onChange
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const onChange = (event, formData ) => {
let updatedField
const updateForm = formData.get("updateForm")
const isRequired = formData.get("isRequired")
- 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 validate2And3SchemasDefaultsMatchAnEnum
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const validate2And3SchemasDefaultsMatchAnEnum = () => (system) => {
return system.validateSelectors
.allSchemas()
.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 componentDidUpdate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
componentDidUpdate(prevProps) {
if(this.props.isOpen === prevProps.isOpen) {
return
}
- 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 validators
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const validators = () => (system) => {
return Object.keys(system.validateActions)
.filter(name => {
// The action needs to start with the prefix "validate..."
if(name.indexOf("validate") !== 0)
- 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 validate2And3TypeArrayRequiresItems
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const validate2And3TypeArrayRequiresItems = () => (system) => {
return system.validateSelectors
.allSchemas()
.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 SemanticValidatorsPlugin
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function SemanticValidatorsPlugin({getSystem}) {
const debAll = debounce((system) => system.validateActions.all(), 300)
const traverseOnce = makeTraverseOnce(getSystem)
- 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 getCompletions
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
export default function getCompletions(editor, session, pos, prefix, cb, ctx, system) {
Function getCompletions
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
export default function getCompletions(editor, session, pos, prefix, cb, ctx, system) {
Function getCompletions
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
export default function getCompletions(editor, session, pos, prefix, cb, ctx, system) {
Function getCompletions
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
export default function getCompletions(editor, session, pos, prefix, cb, ctx, system) {
Function render
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
render() {
let addedOption = <span />
const addButton = <a role="button" className="d-inline-block float-right" onClick={this.showAddField} onKeyDown={this.onEnterKeyPress} tabIndex={0}>Add</a>
if (this.props.isValidAddition) {
if (this.state.showAddOption) {
- 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 render
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
render() {
return (
<div>
{this.props.bigTextBox ?
<textarea
- 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 getPathForPosition
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function getPathForPosition({ pos: originalPos, prefix, editorValue, AST }) {
var pos = Object.assign({}, originalPos)
var lines = editorValue.split(/\r\n|\r|\n/)
var previousLine = lines[pos.row - 1] || ""
var currentLine = lines[pos.row]
- 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
Avoid deeply nested control flow statements. Open
if (!effectiveConsumes.includes("application/x-www-form-urlencoded") && !effectiveConsumes.includes("multipart/form-data")) {
acc.push({
message: `Operations with parameters of "in: formData" must include "application/x-www-form-urlencoded" or "multipart/form-data" in their "consumes" property`,
path: [...node.path, method],
level: "error",
Function getCompletions
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
completer.getCompletions = function(editor, session, pos, prefix, callback) {