codenautas/tedede

View on GitHub

Showing 19 of 35 total issues

File typed-controls.js has 1168 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"use strict";

(function codenautasModuleDefinition(root, name, factory) {
    /* global define */
    /* istanbul ignore next */
Severity: Major
Found in lib/typed-controls.js - About 3 days to fix

    Function adaptElement has 403 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    TypedControls.adaptElement = function adaptElement(domElement, typerOrTypeInfo){
        // typeInfo = TypedControls.completeTypeInfo(typeInfo);
        if(typeof typerOrTypeInfo === 'string'){
            throw new Error("obsolete typeName in adaptElement "+typerOrTypeInfo);
        }
    Severity: Major
    Found in lib/typed-controls.js - About 2 days to fix

      File ctest.js has 365 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      "use strict";
      
      var keys = null;
      var baseUrl = 'http://localhost:43091';
      var testUrl = baseUrl + '/demo';
      Severity: Minor
      Found in server/ctest.js - About 4 hrs to fix

        Function setTypedValue has 75 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            domElement.setTypedValue = function setTypedValue(typedValue, fromUserInteraction){
                var self = this
                var isSameValue;
                if(setup){
                    isSameValue = bestGlobals.sameValue(self.previousValue, typedValue);
        Severity: Major
        Found in lib/typed-controls.js - About 3 hrs to fix

          Consider simplifying this complex logical expression.
          Open

              if(typedControlsOptionGroup){
                  var inputTypeRadio=[];
                  var idElement = domElement.id||'__id__'+iiiiiiid++;
                  domElement.setAttribute("typed-controls-option-group",idElement);
                  domElement.typedControlsValidOptions={};
          Severity: Critical
          Found in lib/typed-controls.js - About 2 hrs to fix

            Function validateWhileInput has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            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 */
            Severity: Minor
            Found in lib/typed-controls.js - About 1 hr to fix

              Function exports has 43 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              module.exports = function(config, preConfig) {
                config.set({
              
                  // base path that will be used to resolve all patterns (eg. files, exclude)
                  basePath: '',
              Severity: Minor
              Found in karma.conf.js - About 1 hr to fix

                Consider simplifying this complex logical expression.
                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);
                Severity: Critical
                Found in lib/typed-controls.js - About 1 hr to fix

                  Function onKeyPressListenerForDiv has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  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
                  Severity: Minor
                  Found in lib/typed-controls.js - About 1 hr to fix

                    Function server has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    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;
                    Severity: Minor
                    Found in server/pdemo-server.js - About 55 mins to fix

                    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

                    function testSendClickToGroupAndCompare(test, groupId, elementId, expected, description, expectedRegisteredEvents){
                    Severity: Minor
                    Found in server/ctest.js - About 45 mins to fix

                      Function testSendKeyAndCompare has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      function testSendKeyAndCompare(test, elementId, key, expected, description, expectedRegisteredEvents){
                      Severity: Minor
                      Found in server/ctest.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if('valueNoData' in typer.typeInfo){
                                                    valueNoData=typer.typeInfo.valueNoData;
                                                }else{
                                                    valueNoData=TypedControls.VALUE_NO_DATA;
                                                }
                        Severity: Major
                        Found in lib/typed-controls.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if('valueUnknownData' in typer.typeInfo){
                                                      valueUnknownData=typer.typeInfo.valueUnknownData;
                                                  }else{
                                                      valueUnknownData=TypedControls.VALUE_UNKNOWN_DATA;
                                                  }
                          Severity: Major
                          Found in lib/typed-controls.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                if(domElement.lupa.timerReubicate){
                                                    clearInterval(domElement.lupa.timerReubicate);
                                                }
                            Severity: Major
                            Found in lib/typed-controls.js - About 45 mins to fix

                              Consider simplifying this complex logical expression.
                              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
                              Severity: Major
                              Found in lib/typed-controls.js - About 40 mins to fix

                                Function testSendClickAndCompare has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                function testSendClickAndCompare(test, elementId, expected, description, expectedRegisteredEvents){
                                Severity: Minor
                                Found in server/ctest.js - About 35 mins to fix

                                  Function testCompare has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                  function testCompare(test, elementId, expected, description, expectedRegisteredEvents){
                                  Severity: Minor
                                  Found in server/ctest.js - About 35 mins to fix

                                    Function codenautasModuleDefinition has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    (function codenautasModuleDefinition(root, name, factory) {
                                        /* global define */
                                        /* istanbul ignore next */
                                        if(typeof root.globalModuleName !== 'string'){
                                            root.globalModuleName = name;
                                    Severity: Minor
                                    Found in lib/typed-controls.js - About 35 mins to fix

                                    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

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language