Showing 25 of 30 total issues
Function jsonSchemaMetadata
has 327 lines of code (exceeds 25 allowed). Consider refactoring. Open
const jsonSchemaMetadata = validate => {
const getSchema = M.getSchema
const metadata = M.metadata()
const jscMetadata = {}
File jsonSchemaMetadata.js
has 344 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
identity,
always,
emptyObject,
isFunction,
Function jsonSchemaMetadata
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
const jsonSchemaMetadata = validate => {
const getSchema = M.getSchema
const metadata = M.metadata()
const jscMetadata = {}
- 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 customLaunchers
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
function customLaunchers() {
return {
SL_Chrome: {
base: 'SauceLabs',
browserName: 'chrome',
Function getSchema
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getSchema = (metaOrType: Object, topLevel: boolean = true): Object => {
const metadata = metaOrTypeMapper(M.metadata()._)(metaOrType)
if (metadataSchemaCache.has(metadata)) {
return metadataSchemaCache.get(metadata) || emptyObject
Function memFactory
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export const memFactory = (
memCacheRegistry: WeakMap<Function, any> = new WeakMap()
) => {
const mem = (f: Function, cacheFn: Function = memDefaultCacheFn) => (
a: mixed,
- 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 constructor
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(arg1, arg2 = emptyObject, thisArg) {
let fields = arg2
let Type = this.constructor
if (isPlainObject(arg1)) {
Function exports
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
Function iterableReviverFactory
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const iterableReviverFactory = (IterableType: any, itemMetadata: any) => (
k,
v,
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 getSchema
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const getSchema = (metaOrType: Object, topLevel: boolean = true): Object => {
const metadata = metaOrTypeMapper(M.metadata()._)(metaOrType)
if (metadataSchemaCache.has(metadata)) {
return metadataSchemaCache.get(metadata) || emptyObject
- 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 createUnionType
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createUnionType = (metasOrTypes, classifier, union = defaultUnion) => {
const metas = metasOrTypes.map(
x => (isPlainObject(x) && !(x instanceof M.Enum) ? x : M.metadata()._(x))
)
Function iterableEquals
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const iterableEquals = (
thisArg: any,
other: any,
asUnordered: boolean = 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 toJSON
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
toJSON() {
const v = this.inner()
return Object.is(v, -0)
? '-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 getSchemaImpl
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getSchemaImpl = (metadata: Object): Object => {
if (metadata.schema) {
return enhanceSchemaWithDefault(metadata, metadata.schema())
}
Function equals
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
equals(other, asUnordered = false) {
if (this === other) {
return true
}
- 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 reviverFactory
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const reviverFactory = (keyMetadata, valueMetadata) => (k, v, path = []) => {
if (k !== '') {
return v
}
- 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 createModel
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const createModel = (
innerTypes = emptyObject,
{base = Base, stringTag = 'ModelicoModel', metadata: m = metadata} = {}
) => {
const Model = class extends base {
- 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 createUnionType
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const createUnionType = (metasOrTypes, classifier, union = defaultUnion) => {
const metas = metasOrTypes.map(
x => (isPlainObject(x) && !(x instanceof M.Enum) ? x : M.metadata()._(x))
)
- 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 reviverFactory
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const reviverFactory = (keyMetadata, valueMetadata) => (k, v, path = []) => {
if (k !== '') {
return v
}
- 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 reviverFactory
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const reviverFactory = enumerators => (
k,
v,
path = [],
{default: def} = {}
- 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"