Showing 19 of 35 total issues
File typed-controls.js
has 1168 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"use strict";
(function codenautasModuleDefinition(root, name, factory) {
/* global define */
/* istanbul ignore next */
Function adaptElement
has 403 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
TypedControls.adaptElement = function adaptElement(domElement, typerOrTypeInfo){
// typeInfo = TypedControls.completeTypeInfo(typeInfo);
if(typeof typerOrTypeInfo === 'string'){
throw new Error("obsolete typeName in adaptElement "+typerOrTypeInfo);
}
File ctest.js
has 365 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"use strict";
var keys = null;
var baseUrl = 'http://localhost:43091';
var testUrl = baseUrl + '/demo';
Function setTypedValue
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
domElement.setTypedValue = function setTypedValue(typedValue, fromUserInteraction){
var self = this
var isSameValue;
if(setup){
isSameValue = bestGlobals.sameValue(self.previousValue, typedValue);
Consider simplifying this complex logical expression. Open
Open
if(typedControlsOptionGroup){
var inputTypeRadio=[];
var idElement = domElement.id||'__id__'+iiiiiiid++;
domElement.setAttribute("typed-controls-option-group",idElement);
domElement.typedControlsValidOptions={};
Function validateWhileInput
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
domElement.validateWhileInput = function validateWhileInput(){
var plainValue = this.getPlainValue();
var typer = this.controledType||{typeInfo:{}};
if(TypedControls.ENABLE_SIGNALS && typer.typeInfo.typeName!='text' || TypedControls.ENABLE_SIGNALS4ALL){
/* NO DATA SIGNAL */
Function exports
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(config, preConfig) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
Consider simplifying this complex logical expression. Open
Open
if(event.keyCode == 120 && !event.shiftKey && !event.ctrlKey && !event.altKey
|| event.which == 40 && !event.shiftKey && !event.ctrlKey && event.altKey
){ //F9 alt down
if(!domElement.updatingSuspended){
displayExpander(event);
Function onKeyPressListenerForDiv
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
'keydown': function onKeyPressListenerForDiv(event){
var typer = this.controledType||{typeInfo:{}};
if(TypedControls.ENABLE_SIGNALS && typer.typeInfo.typeName!='text' || TypedControls.ENABLE_SIGNALS4ALL){
var theKey=event.keyCode;
// subtract or dash key
Function server
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
var server = app.listen(PORT, function(){
console.log('Listening on port %d', server.address().port);
console.log('launch browser');
var spawn = require('child_process').spawn;
var args = process.argv;
- 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 testSendClickToGroupAndCompare
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function testSendClickToGroupAndCompare(test, groupId, elementId, expected, description, expectedRegisteredEvents){
Function testSendKeyAndCompare
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function testSendKeyAndCompare(test, elementId, key, expected, description, expectedRegisteredEvents){
Avoid deeply nested control flow statements. Open
Open
if('valueNoData' in typer.typeInfo){
valueNoData=typer.typeInfo.valueNoData;
}else{
valueNoData=TypedControls.VALUE_NO_DATA;
}
Avoid deeply nested control flow statements. Open
Open
if('valueUnknownData' in typer.typeInfo){
valueUnknownData=typer.typeInfo.valueUnknownData;
}else{
valueUnknownData=TypedControls.VALUE_UNKNOWN_DATA;
}
Avoid deeply nested control flow statements. Open
Open
if(domElement.lupa.timerReubicate){
clearInterval(domElement.lupa.timerReubicate);
}
Consider simplifying this complex logical expression. Open
Open
if(this.type==='checkbox' && (
event.keyCode == 8 || //backspace
event.keyCode == 46 || //delete/Supr
event.keyCode == 109 || //'-'/minus in keypad
event.keyCode == 189 || //'-'/minus in keyboard
Function testSendClickAndCompare
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function testSendClickAndCompare(test, elementId, expected, description, expectedRegisteredEvents){
Function testCompare
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function testCompare(test, elementId, expected, description, expectedRegisteredEvents){
Function codenautasModuleDefinition
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
(function codenautasModuleDefinition(root, name, factory) {
/* global define */
/* istanbul ignore next */
if(typeof root.globalModuleName !== 'string'){
root.globalModuleName = 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"