Showing 41 of 65 total issues
File virtual_forms_test.js
has 520 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict'
var isNode = typeof module !== 'undefined' && module.exports !== undefined
describe('VirtualForms', () => {
File router_test.js
has 518 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict'
describe('Router', () => {
describe('constructor', () => {
it('should have complete set of properties', () => {
File routing_mapper_test.js
has 479 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict'
describe('RoutingMapper', () => {
describe('page', () => {
it('should add a route to specified component', () => {
Function apply
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
apply() {
let forms, i, len, form, formName, tForm, j, elements, elem, elemName, k
forms = this.component.root.getElementsByTagName('form')
- 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 markup_builder_test.js
has 463 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict'
var isNode = typeof module !== 'undefined' && module.exports !== undefined
describe('MarkupBuilder', () => {
Function compile
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
compile() {
let forms, elements, i, j, elem, segments, lastSegment, obj, o, name
this.realForms = {}
forms = this.main.component.root.getElementsByTagName('form')
- 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 markup_builder.js
has 432 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict'
let virtualDom = require('virtual-dom')
let Inflector = require('inflected')
let Cape = require('./utilities')
File resource_agent_test.js
has 400 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict'
class UserAgent extends Cape.ResourceAgent {
constructor(client, options) {
super(client, options)
Function val
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
val(arg1, arg2) {
let key1, key2, value
if (typeof arg1 === 'object') {
for (key1 in arg1) {
- 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 collection_agent_test.js
has 297 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict'
class UserCollectionAgent extends Cape.CollectionAgent {
constructor(client, options) {
super(client, options)
File virtual_forms.js
has 292 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict'
let Cape = require('./utilities')
// Cape.VirtualForms
MarkupBuilder
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class MarkupBuilder {
constructor(component, options) {
this._ = new _Internal(this)
this.component = component
if (options) {
File routing_mapper.js
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict'
let Inflector = require('inflected')
let Cape = require('./utilities')
ResourceAgent
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class ResourceAgent {
constructor(client, options) {
let adapterName, adapter
options = options || {}
Function render
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
render(m) {
m.formFor('', m => {
m.hiddenField('dummy')
m.labelFor('name', 'Name').sp().textField('name').br()
m.labelFor('password', 'Password').sp().passwordField('name').br()
Function setValuesOfNestedFields
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
setValuesOfNestedFields(formName, prefix, obj) {
let attrName, key, self
for (key in obj) {
attrName = prefix ? prefix + '/' + key : key
- 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 object2array
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
object2array(obj) {
let isArray = true, _obj, key, ary = []
_obj = Cape.deepExtend({}, obj)
for (key in _obj) {
- 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 update
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
update(formName, options) {
let tForm
tForm = this._.tempForms[formName]
if (tForm === 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 apply
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
apply() {
let forms, i, len, form, formName, tForm, j, elements, elem, elemName, k
forms = this.component.root.getElementsByTagName('form')
Function compile
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
compile() {
let forms, elements, i, j, elem, segments, lastSegment, obj, o, name
this.realForms = {}
forms = this.main.component.root.getElementsByTagName('form')