Showing 41 of 65 total issues
Function exports
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(config) {
config.set({
basePath: '',
autoWatch: true,
frameworks: ['mocha'],
Function deepExtend
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Cape.deepExtend = function() {
let i, key
for (i = 1; i < arguments.length; i++)
for (key in arguments[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
Function stubFetchAPI
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function stubFetchAPI(spy, data, dataType) {
data = data || '{}';
var response = { status: 200 };
if (dataType) {
Function ajax
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
ajax: function(httpMethod, path, params, callback, errorHandler) {
params = params || {}
errorHandler = errorHandler || this.defaultErrorHandler
this._.applyAdapter()
Function checkedOn
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
checkedOn(name) {
let names, formName, attrName, forms, elements, cb, value
names = this._.getNames(name)
formName = names[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
Avoid deeply nested control flow statements. Open
if (elem.name.slice(-2) === '[]') {
if (!Array.isArray(obj[elem.name])) obj[elem.name] = []
if (elem.checked) obj[elem.name].push(elem.value)
}
else {
Function ajax
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
ajax: function(httpMethod, path, params, callback, errorHandler) {
params = params || {}
errorHandler = errorHandler || this.defaultErrorHandler
this._.applyAdapter()
- 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
for (k = 0; k < tForm[elemName].length; k++) {
if (elem.value === tForm[elemName][k]) {
elem.checked = true
break
}
Avoid deeply nested control flow statements. Open
if (elem.value !== tForm[elemName])
elem.value = tForm[elemName] ? tForm[elemName] : ''
Avoid deeply nested control flow statements. Open
else if (elem.type === 'radio') {
if (elem.checked) obj[elem.name] = elem.value
}
else {
obj[elem.name] = elem.value
Avoid deeply nested control flow statements. Open
for (key2 in value) {
if (value.hasOwnProperty(key2)) {
this._.setValue(key1 + '.' + key2, value[key2])
}
}
Function ajax
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
ajax: function(httpMethod, path, params, callback, errorHandler) {
Function merge
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Cape.merge = function() {
let i, key
for (i = 1; i < arguments.length; i++)
for (key in arguments[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
Function getValue
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
getValue(name) {
let names, formName, attrName, form, _form
names = this.getNames(name)
formName = names[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 extractClassNames
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
extractClassNames(classNames, options) {
if (typeof options['className'] === 'object') {
for (let name in options['className']) {
if (options['className'][name]) classNames.push(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 show
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
show(klass, params) {
this.query = {}
if (params !== undefined) {
for (let prop in params) {
if ({}.hasOwnProperty.call(params, prop)) {
- 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 getComponentClassFor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
getComponentClassFor(route) {
let fragments = []
if (route.container) {
route.container.split('.').forEach(part => {
fragments.push(Inflector.camelize(part))
- 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 mount
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
mount(id) {
if (id === undefined)
throw new Error("The first argument is missing.")
if (typeof id !== 'string')
throw new Error("The first argument must be a 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 textareaField
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
textareaField(attrName, options) {
let formName, vform, dasherized
if (attrName && this.fieldNamePrefix)
attrName = this.fieldNamePrefix + '/' + attrName
- 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 redirectTo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
redirectTo(hash, params, options) {
// For backward compatibility, if the second argument has a key 'notice'
// or 'alert' and the third argument is undefined, the second argument
// should be treated as options.
if (typeof params === 'object' && options === 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"