Showing 112 of 206 total issues
Function validateOAS3SchemaPropertiesReadOnlyWriteNotBothTrue
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export const validateOAS3SchemaPropertiesReadOnlyWriteNotBothTrue = () => (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 makeEditor
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export default function makeEditor({ editorPluginsToRun }) {
class Editor extends React.Component {
constructor(props, context) {
- 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 isSubSchema
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const isSubSchema = (state, node) => (sys) => {
const path = node.path
if(path.length < 3) {
return false
}
- 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 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function find(astValue, astKeyValue) {
if (astValue.tag === MAP_TAG) {
for (i = 0; i < astValue.value.length; i++) {
var pair = astValue.value[i]
var key = pair[0]
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 => {
Function getLineNumberForPath
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getLineNumberForPath(yaml, path) {
// Type check
if (typeof yaml !== "string") {
throw new TypeError("yaml should be a string")
Function updatedFormData
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
const updatedFormData = formData.map((formItem) => {
const value = formItem.get("value")
const isRequired = formItem.get("isRequired")
// The form field represents a mapping (keyValue => value).
Function getKeywordsForPath
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export default function getKeywordsForPath({ system, path, keywordMap }) {
keywordMap = Object.assign({}, keywordMap)
// is getting path was not successful stop here and return no candidates
if (!isArray(path)) {
- 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 getRefType
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const getRefType = (state, path) => (sys) => createSelector(
() => {
for( var i=path.length-1; i>-1; i-- ) {
let tag = path[i]
if(sys.specSelectors.isOAS3 && sys.specSelectors.isOAS3()) {
- 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 getKeywordsForPath
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export default function getKeywordsForPath({ system, path, keywordMap}) {
keywordMap = Object.assign({}, keywordMap)
// is getting path was not successful stop here and return no candidates
if (!isArray(path)) {
- 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 transformPathToArray
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function transformPathToArray(property, jsSpec) {
if (property.slice(0, 9) === "instance.") {
var str = property.slice(9)
} else {
// eslint-disable-next-line no-redeclare
Function find
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function find(current) {
// algorythm:
// is current a promitive?
// // finish recursion without modifying the path
Function validate2And3TypesInDefaultValuesMatchesWithEnum
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const validate2And3TypesInDefaultValuesMatchesWithEnum = () => (system) => {
return system.validateSelectors
.allSchemas()
.then(nodes => {
return nodes.reduce((acc, node) => {
Function validateParameterFormDataConsumesType
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const validateParameterFormDataConsumesType = () => system => {
return system.validateSelectors
.allPathItems()
.then(nodes => {
return nodes.reduce((acc, node) => {
Function validateOAS3ParameterRefsReferenceParameterPositions
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export const validateOAS3ParameterRefsReferenceParameterPositions = () => sys => {
return sys.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 validateOAS3RefsForHeadersReferenceHeadersPositions
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export const validateOAS3RefsForHeadersReferenceHeadersPositions = () => sys => {
return sys.validateSelectors
.allHeaders()
.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 validate
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
validate({ jsSpec, specStr, schemaPath, source }) {
this.ajv.validate(normalizeKey(schemaPath), jsSpec)
if (!this.ajv.errors || !this.ajv.errors.length) {
return null
Function default
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function () {
const ADD_TO_SPEC = "add_to_spec"
return {
components: {
Function makeTraverseOnce
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function makeTraverseOnce(getSystem) {
let traversers = {}
let results = {}
let deferred = null
Function wrapCompleters
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function wrapCompleters(completers, cutoff = 100) {
let isLiveCompletionDisabled = false
let lastSpeeds = []
let isPerformant = () => lastSpeeds.every(speed => speed < cutoff)