codenautas/tedede

View on GitHub

Showing 35 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

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        TypedControls.i18n.messages.es={
            Yes: 'Sí',
            No: 'No',
            Null: 'Nulo/Sin valor',
            pikaday: {
        Severity: Major
        Found in lib/typed-controls.js and 1 other location - About 3 hrs to fix
        lib/typed-controls.js on lines 44..57

        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 105.

        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

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        TypedControls.i18n.messages.en={
            Yes: 'Yes',
            No: 'No',
            Null: 'Null/Empty',
            pikaday: {
        Severity: Major
        Found in lib/typed-controls.js and 1 other location - About 3 hrs to fix
        lib/typed-controls.js on lines 58..71

        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 105.

        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

        Further Reading

        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

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                          if(plainValue==TypedControls.SIGNAL_UNKNOWN_DATA || plainValue==TypedControls.VALUE_UNKNOWN_DATA || 
                              (self.controledType.typeInfo.valueUnknownData && self.controledType.typeInfo.valueUnknownData == plainValue)){
                              self.setAttribute('typed-controls-signal-unknown-data','1');
                          }else{
                              self.removeAttribute('typed-controls-signal-unknown-data');
          Severity: Major
          Found in lib/typed-controls.js and 1 other location - About 2 hrs to fix
          lib/typed-controls.js on lines 1047..1052

          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 90.

          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

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                          if(plainValue==TypedControls.SIGNAL_NO_DATA || plainValue==TypedControls.VALUE_NO_DATA ||
                              (self.controledType.typeInfo.valueNoData && self.controledType.typeInfo.valueNoData == plainValue)){
                              self.setAttribute('typed-controls-signal-no-data','1');
                          }else{
                              self.removeAttribute('typed-controls-signal-no-data');
          Severity: Major
          Found in lib/typed-controls.js and 1 other location - About 2 hrs to fix
          lib/typed-controls.js on lines 1041..1046

          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 90.

          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

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                          case 'alertPromise':
                              setup.preDialogFun(self, typedValue).then(function(){
                                  alertPromise(setup.message,setup.opts).then(function(){
                                      setTypedValueFun();
                                  }).catch(function(err){
          Severity: Major
          Found in lib/typed-controls.js and 1 other location - About 2 hrs to fix
          lib/typed-controls.js on lines 1094..1102

          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 87.

          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

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                          default:
                              setup.preDialogFun(self, typedValue).then(function(){
                                  confirmPromise(setup.message,setup.opts).then(function(){
                                      setTypedValueFun();
                                  }).catch(function(err){
          Severity: Major
          Found in lib/typed-controls.js and 1 other location - About 2 hrs to fix
          lib/typed-controls.js on lines 1074..1082

          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 87.

          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

          Further Reading

          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

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                                if((theKey==111 || theKey==191) && (this.previousKey==111 || this.previousKey==191)){
                                    var valueUnknownData;
                                    if('valueUnknownData' in typer.typeInfo){
                                        valueUnknownData=typer.typeInfo.valueUnknownData;
                                    }else{
            Severity: Major
            Found in lib/typed-controls.js and 1 other location - About 2 hrs to fix
            lib/typed-controls.js on lines 739..749

            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 81.

            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

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                                if((theKey==109 || theKey==189) && (this.previousKey==109 || this.previousKey==189)){
                                    var valueNoData;
                                    if('valueNoData' in typer.typeInfo){
                                        valueNoData=typer.typeInfo.valueNoData;
                                    }else{
            Severity: Major
            Found in lib/typed-controls.js and 1 other location - About 2 hrs to fix
            lib/typed-controls.js on lines 751..761

            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 81.

            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

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                            if((theKey==109 || theKey==189) && (this.previousKey==109 || this.previousKey==189)){
                                var valueNoData;
                                if('valueNoData' in typer.typeInfo){
                                    valueNoData=typer.typeInfo.valueNoData;
                                }else{
            Severity: Major
            Found in lib/typed-controls.js and 1 other location - About 2 hrs to fix
            lib/typed-controls.js on lines 378..387

            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 75.

            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

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                            if((theKey==111 || theKey==191) && (this.previousKey==111 || this.previousKey==191)){
                                var valueUnknownData;
                                if('valueUnknownData' in typer.typeInfo){
                                    valueUnknownData=typer.typeInfo.valueUnknownData;
                                }else{
            Severity: Major
            Found in lib/typed-controls.js and 1 other location - About 2 hrs to fix
            lib/typed-controls.js on lines 367..376

            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 75.

            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

            Further Reading

            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

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                                    if(Math.abs(top-domElement.lupa.style.top.replace('px',''))>1.2){
                                        domElement.lupa.style.top=top+'px';
                                    }
                Severity: Major
                Found in lib/typed-controls.js and 1 other location - About 1 hr to fix
                lib/typed-controls.js on lines 857..859

                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 67.

                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

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                                    if(Math.abs(left-domElement.lupa.style.left.replace('px',''))>1.2){
                                        domElement.lupa.style.left=left+'px';
                                    }
                Severity: Major
                Found in lib/typed-controls.js and 1 other location - About 1 hr to fix
                lib/typed-controls.js on lines 854..856

                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 67.

                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

                Further Reading

                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
                  Severity
                  Category
                  Status
                  Source
                  Language