Function make
has a Cognitive Complexity of 337 (exceeds 5 allowed). Consider refactoring. Invalid
function make<S>(intop?: S | Node<S>, inopts?: GubuOptions) {
const opts: GubuOptions = null == inopts ? {} : inopts
// Ironically, we can't Gubu GubuOptions, so we have to set
// option defaults manually.
- 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
File gubu.ts
has 1950 lines of code (exceeds 250 allowed). Consider refactoring. Invalid
/* Copyright (c) 2021-2023 Richard Rodger and other contributors, MIT License */
// FIX: does not work if Gubu is inside a Proxy - jest fails
// FEATURE: regexp in array: [/a/] => all elements must match /a/
Function make
has 364 lines of code (exceeds 25 allowed). Consider refactoring. Invalid
function make<S>(intop?: S | Node<S>, inopts?: GubuOptions) {
const opts: GubuOptions = null == inopts ? {} : inopts
// Ironically, we can't Gubu GubuOptions, so we have to set
// option defaults manually.
Function exec
has 290 lines of code (exceeds 25 allowed). Consider refactoring. Invalid
function exec(
root: any,
ctx?: Context,
match?: boolean // Suppress errors and return boolean result (true if match)
): any {
Function makeErrImpl
has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring. Invalid
function makeErrImpl(
why: string,
s: State,
mark: number,
text?: string,
- 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 nodize
has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring. Invalid
function nodize<S>(shape?: any, depth?: number, meta?: NodeMeta): Node<S> {
// If using builder as property of Gubu, `this` is just Gubu, not a node.
if (make === shape) {
shape = 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 Rename
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Invalid
const Rename = function <V>(this: any, inopts: any, shape?: Node<V> | V): Node<V> {
let node = buildize(this, shape)
let opts = S.object === typeof inopts ? inopts || {} : {}
let name = S.string === typeof inopts ? inopts : opts.name
- 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 MakeArgu
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Invalid
function MakeArgu(prefix: string): Argu {
// TODO: caching, make arguments optionals
return function Argu(
args: args | string,
- 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 nodize
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Invalid
function nodize<S>(shape?: any, depth?: number, meta?: NodeMeta): Node<S> {
// If using builder as property of Gubu, `this` is just Gubu, not a node.
if (make === shape) {
shape = undefined
Function MakeArgu
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Invalid
function MakeArgu(prefix: string): Argu {
// TODO: caching, make arguments optionals
return function Argu(
args: args | string,
Function handleValidate
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Invalid
function handleValidate(vf: Validate, s: State): Update {
let update: Update = {}
let valid = false
let thrown
- 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 Argu
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Invalid
return function Argu(
args: args | string,
whence: string | Record<string, any>,
argSpec?: Record<string, any>
) {
Function expr
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Invalid
function expr(spec: {
src: string
val: any
tokens?: string[]
i?: number
- 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 Rename
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Invalid
const Rename = function <V>(this: any, inopts: any, shape?: Node<V> | V): Node<V> {
let node = buildize(this, shape)
let opts = S.object === typeof inopts ? inopts || {} : {}
let name = S.string === typeof inopts ? inopts : opts.name
Function makeErrImpl
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Invalid
function makeErrImpl(
why: string,
s: State,
mark: number,
text?: string,
Function expr
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Invalid
function expr(spec: {
src: string
val: any
tokens?: string[]
i?: number
Function stringify
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Invalid
function stringify(src: any, replacer?: any, dequote?: boolean, expand?: boolean) {
let str: string
if (!expand &&
src && src.$ && (GUBU$ === src.$.gubu$ || true === (src.$ as any).gubu$)) {
Function handleValidate
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Invalid
function handleValidate(vf: Validate, s: State): Update {
let update: Update = {}
let valid = false
let thrown
Function Key
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Invalid
const Key = function(this: any, depth?: number | Function, join?: string) {
let node = buildize(this)
let ascend = S.number === typeof depth
node.t = (S.string as ValType)
- 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 Exact
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const Exact = function(this: any, ...vals: any[]) {
let node = buildize()
node.b.push(function Exact(val: any, update: Update, state: State) {
for (let i = 0; i < vals.length; i++) {
- 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
Consider simplifying this complex logical expression. Open
else if (!(
S.any === s.type ||
S.list === s.type ||
undefined === s.val ||
s.type === s.valType ||
Function before
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Invalid
let before = (val: any, update: Update, s: State) => {
if (undefined === val && 0 < claim.length) {
s.ctx.Rename = (s.ctx.Rename || {})
s.ctx.Rename.fromDflt = (s.ctx.Rename.fromDflt || {})
Function next
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Invalid
next() {
// Uncomment for debugging (definition below).
// this.printStacks()
this.stop = false
Function Check
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Invalid
const Check = function <V>(
this: any,
check: Validate | RegExp | string,
shape?: Node<V> | V
): Node<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 Refer
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Invalid
const Refer = function <V>(this: any, inopts: any, shape?: Node<V> | V): Node<V> {
let node = buildize(this, shape)
let opts = S.object === typeof inopts ? inopts || {} : {}
let name = S.string === typeof inopts ? inopts : opts.name
- 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
Consider simplifying this complex logical expression. Invalid
else if (true === shape.$.gubu$) {
let node = { ...shape }
node.$ = { v$: VERSION, ...node.$, gubu$: GUBU$ }
node.v =
Function Key
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Invalid
const Key = function(this: any, depth?: number | Function, join?: string) {
let node = buildize(this)
let ascend = S.number === typeof depth
node.t = (S.string as ValType)
Function buildize
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Invalid
function buildize<V>(node0?: any, node1?: any): Node<V> {
// Detect chaining. If not chained, ignore `this` if it is the global context.
let node =
nodize(null == node0 || node0.window === node0 || node0.global === node0
? node1 : node0)
Function Check
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Invalid
const Check = function <V>(
this: any,
check: Validate | RegExp | string,
shape?: Node<V> | V
): Node<V> {
Function Some
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Invalid
const Some = function(this: any, ...inshapes: any[]) {
let node = buildize()
node.t = (S.list as ValType)
node.r = true
Function One
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Invalid
const One = function(this: any, ...inshapes: any[]) {
let node = buildize()
node.t = (S.list as ValType)
node.r = true
Function Exact
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Exact = function(this: any, ...vals: any[]) {
let node = buildize()
node.b.push(function Exact(val: any, update: Update, state: State) {
for (let i = 0; i < vals.length; i++) {
Function All
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Invalid
const All = function(this: any, ...inshapes: any[]) {
let node = buildize()
node.t = (S.list as ValType)
node.r = true
Avoid deeply nested control flow statements. Invalid
if (null != val) {
s.ctx.log && s.ctx.log('so', s)
let hasKeys = false
let vkeys = keys(n.v)
Avoid deeply nested control flow statements. Open
if (n.r && valundef) {
s.ignoreVal = true
s.curerr.push(makeErrImpl(S.required, s, 1030))
}
else if (!valundef && !isarr(s.val)) {
Avoid deeply nested control flow statements. Invalid
if (!s.match) {
s.parent[name] = update.val
}
Avoid deeply nested control flow statements. Open
else if (S.regexp === s.type) {
if (valundef && !n.r) {
s.ignoreVal = true
}
else if (S.string !== s.valType) {
Avoid deeply nested control flow statements. Open
for (let eI = 0; eI < s.err.length; eI++) {
if (s.err[eI].k === fromDflt.key) {
s.err.splice(eI, 1)
eI--
}
Function makeErrImpl
has 6 arguments (exceeds 4 allowed). Consider refactoring. Invalid
why: string,
s: State,
mark: number,
text?: string,
user?: any,
Avoid deeply nested control flow statements. Invalid
if (top.v[keys[sI]].m.rest) {
argmap[keys[sI]]
.splice(top.v[keys[sI]].m.rest_pos + kI - sI, 0,
argmap[keys[sI - 1]])
}
Avoid deeply nested control flow statements. Open
if (!keep) {
delete s.parent[cn]
}
else {
let j = s.cI + 1
Consider simplifying this complex logical expression. Invalid
if (hasValueElements || hasFixedElements) {
s.pI = s.nI
let elementIndex = 0
Function All
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Invalid
const All = function(this: any, ...inshapes: any[]) {
let node = buildize()
node.t = (S.list as ValType)
node.r = 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 truncate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Invalid
function truncate(str?: string, len?: number): string {
let strval = String(str)
let outlen = null == len || isNaN(len) ? 30 : len < 0 ? 0 : ~~len
let strlen = null == str ? 0 : strval.length
let substr = null == str ? '' : strval.substring(0, strlen)
- 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 Some
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Invalid
const Some = function(this: any, ...inshapes: any[]) {
let node = buildize()
node.t = (S.list as ValType)
node.r = 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 node2str
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function node2str(n: Node<any>): string {
return (null != n.s && '' !== n.s) ? n.s :
(!n.r && undefined !== n.v) ?
('function' === typeof n.v.constructor ? n.v : n.v.toString())
: n.t
- 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 One
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Invalid
const One = function(this: any, ...inshapes: any[]) {
let node = buildize()
node.t = (S.list as ValType)
node.r = 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 next
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Invalid
next() {
// Uncomment for debugging (definition below).
// this.printStacks()
this.stop = 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
Avoid too many return
statements within this function. Invalid
return JP(head)
Avoid too many return
statements within this function. Invalid
return expr(spec)
Avoid too many return
statements within this function. Invalid
return spec.val
Avoid too many return
statements within this function. Invalid
return new RegExp(head.substring(1, head.length - 1))
Avoid too many return
statements within this function. Invalid
return expr(spec)
Function valueLen
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Invalid
function valueLen(val: any) {
return S.number === typeof (val) ? val :
S.number === typeof (val?.length) ? val.length :
null != val && S.object === typeof (val) ? keys(val).length :
NaN
- 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 Define
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Invalid
const Define = function <V>(this: any, inopts: any, shape?: Node<V> | V): Node<V> {
let node = buildize(this, shape)
let opts = S.object === typeof inopts ? inopts || {} : {}
let name = S.string === typeof inopts ? inopts : opts.name
- 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
Similar blocks of code found in 3 locations. Consider refactoring. Invalid
const Above = function <V>(
this: any,
above: number | string,
shape?: Node<V> | V
): Node<V> {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 288.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Invalid
const Max = function <V>(
this: any,
max: number | string,
shape?: Node<V> | V
): Node<V> {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 288.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Invalid
const Below = function <V>(
this: any,
below: number | string,
shape?: Node<V> | V
): Node<V> {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 288.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Invalid
if (!pass) {
update.why = S.All
update.err = [
makeErr(state,
S.Value + ' ' + S.$VALUE + S.forprop + S.$PATH +
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 117.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Invalid
if (!pass) {
update.why = S.Some
update.err = [
makeErr(state,
S.Value + ' ' + S.$VALUE + S.forprop + S.$PATH +
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 117.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Invalid
if (0 < n.a.length) {
for (let aI = 0; aI < n.a.length; aI++) {
let update = handleValidate(n.a[aI], s)
n = s.node
if (undefined !== update.done) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 111.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Invalid
if (0 < n.b.length) {
for (let bI = 0; bI < n.b.length; bI++) {
let update = handleValidate(n.b[bI], s)
n = s.node
if (undefined !== update.done) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 111.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Invalid
const Before = function <V>(
this: any,
validate: Validate,
shape?: Node<V> | V
): Node<V> {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 92.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Invalid
const After = function <V>(
this: any,
validate: Validate,
shape?: Node<V> | V
): Node<V> {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 92.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
(
null != top &&
top.$ &&
(GUBU$ === top.$.gubu$ || true === (top.$ as any).gubu$)
) ? top.v : top) :
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 59.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
n = (null != n && n.$ && (GUBU$ === n.$.gubu$ || true === (n.$ as any).gubu$)) ? n.v : n
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 59.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Invalid
if (undefined === shape && 1 === arguments.length) {
node.t = (S.undefined as ValType)
node.v = undefined
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 57.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Invalid
if (undefined === shape && 1 === arguments.length) {
node.t = (S.undefined as ValType)
node.v = undefined
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 57.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
for (let i = 0; i < vals.length; i++) {
if (valDftl === vals[i]) {
return true
}
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 45.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
for (let i = 0; i < vals.length; i++) {
if (val === vals[i]) {
return true
}
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 45.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76