codenautas/backend-plus

View on GitHub

Showing 408 of 408 total issues

Function configStaticConfig has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

AppBackend.prototype.configStaticConfig = function configStaticConfig(){
    this.setStaticConfig(`
        login:
          unloggedLandPage: /not-logged-in
          plus:
Severity: Major
Found in lib/backend-plus.js - About 2 hrs to fix

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

            detailTables:[
                {table: 'isotopes'      , fields:[{source:'atomic_number', target:'atomic_number'}], abr:'iso', label:'isotopes'},
                {table: 'element_images', fields:[{source:'atomic_number', target:'atomic_number'}], abr:'img', label:'images'  }
            ],
    Severity: Major
    Found in examples/tables/server/table-ptable_multi_edit.js and 1 other location - About 2 hrs to fix
    examples/tables/server/table-ptable.js on lines 28..31

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

    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

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

            detailTables:[
                {table: 'isotopes'      , fields:[{source:'atomic_number', target:'atomic_number'}], abr:'iso', label:'isotopes'},
                {table: 'element_images', fields:[{source:'atomic_number', target:'atomic_number'}], abr:'img', label:'images'  }
            ],
    Severity: Major
    Found in examples/tables/server/table-ptable.js and 1 other location - About 2 hrs to fix
    examples/tables/server/table-ptable_multi_edit.js on lines 30..33

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

    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 coreFunction has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            coreFunction:async function(context, parameters){
                context.informProgress({message:"start"});
                var {be,client} = context;
                if (!be.can(context,'DownloadBackup')) {
                    throw new Error('Forbiden backup')
    Severity: Major
    Found in lib/procedures-table.js - About 2 hrs to fix

      Function putOne has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          async putOne<T>(tableName:string, element:T):Promise<T>{
              var ldb = this;
              var createPromiseForFK = function createPromiseForFK(fk:ForeignKey){
                  return Promise.resolve().then(async function(){
                      var fkTableDef=await ldb.getStructure(fk.references);
      Severity: Major
      Found in src/for-client/my-websqldb.ts - About 2 hrs to fix

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

        module.exports = function(context){
            var admin=context.user.rol==='boss';
            return context.be.tableDefAdapt({
                name:'ptable_multi_edit',
                tableName:'ptable',
        Severity: Minor
        Found in examples/tables/server/table-ptable_multi_edit.js - About 2 hrs to fix

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

                      for(var name in parameters){
                          values.push(parameters[name]);
                          if(name==='table'){name='table_name'}
                          if(name==='primaryKeyValues'){name='pk_values'}
                          fieldNames.push(name);
          Severity: Major
          Found in lib/procedures-table.js and 1 other location - About 2 hrs to fix
          lib/procedures-table.js on lines 648..653

          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

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

                      for(var name in parameters){
                          values.push(parameters[name]);
                          if(name==='table'){name='table_name'}
                          if(name==='primaryKeyValues'){name='pk_values'}
                          fieldNames.push(name);
          Severity: Major
          Found in lib/procedures-table.js and 1 other location - About 2 hrs to fix
          lib/procedures-table.js on lines 612..617

          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

          Consider simplifying this complex logical expression.
          Open

              if(context && !context.plainStructure){
                  resultTableDef.foreignKeys.concat(resultTableDef.softForeignKeys).forEach(function(fkDef){
                      if(fkDef.definingSubclass){
                          return;
                      }
          Severity: Critical
          Found in lib/table-def-adapt.js - About 2 hrs to fix

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

            myOwn.i18n.messages.es = {
                autoCloseWhenEnds: "cerrar la ventana al terminar",
                Cancel   : "Cancelar",
                exportFields: "exportar campos",
                fromOtherTables: "desde otras tablas",
            Severity: Major
            Found in for-client/my-things.js and 1 other location - About 2 hrs to fix
            for-client/my-things.js on lines 49..61

            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

            myOwn.i18n.messages.en = {
                autoCloseWhenEnds: "auto close when ends",
                Cancel   : "Cancel",
                exportFields: "export fields",
                fromOtherTables: "from other tables",
            Severity: Major
            Found in for-client/my-things.js and 1 other location - About 2 hrs to fix
            for-client/my-things.js on lines 63..75

            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 testKeepAlive has 49 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            myOwn.testKeepAlive = function testKeepAlive(){
                var my = this;
                var element = document.getElementById('keep-alive-signal') || my.debugging && document.body.appendChild(html.div({id:'keep-alive-signal'}).create());
                if(element){
                    element.textContent='t';
            Severity: Minor
            Found in for-client/my-things.js - About 1 hr to fix

              Function completar has 49 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                              completar: function completar(celda, be, idFormulario, celdasAgregadas){
                                  if(!celda.variable){
                                      celda.variable = celda.pregunta.toLowerCase();
                                  }
                                  if(!celda.typeInfo && !celda.typeName && !celda["tipo-dato"] && !celda.opciones){
              Severity: Minor
              Found in ejemplos/encuesta.js - About 1 hr to fix

                Function changeOfflineMode has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                myOwn.changeOfflineMode = function changeOfflineMode(){
                    my.offline.mode=!my.offline.mode;
                    my.offlineModeRefresh();
                    my.setOnlineOfflineUrl();
                    if(my.offline.mode){
                Severity: Minor
                Found in for-client/my-menu.js - About 1 hr to fix

                  Function addLoggedServices has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                  Open

                  AppBackend.prototype.addLoggedServices = function addLoggedServices(){
                      var be = this;
                      var skin=be.config['client-setup'].skin;
                      var skinUrl=(skin?skin+'/':'');
                      var slashSkin=(skin?'/'+skin:'');
                  Severity: Minor
                  Found in lib/backend-plus.js - About 1 hr 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

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

                  myOwn.TableGrid.prototype.updateFilterInfo = function updateFilterInfo(filterAppliedContent){
                      this.dom.headInfo.filterApplied.textContent = filterAppliedContent;
                      this.dom.footInfo.filterApplied.textContent = filterAppliedContent;
                  };
                  Severity: Major
                  Found in for-client/my-tables.js and 1 other location - About 1 hr to fix
                  for-client/my-tables.js on lines 2292..2295

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

                  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

                  myOwn.TableGrid.prototype.updateRowCountHTML = function updateRowCountHTML(HTML){
                      this.dom.headInfo.rowCount.innerHTML=HTML;
                      this.dom.footInfo.rowCount.innerHTML=HTML;
                  };
                  Severity: Major
                  Found in for-client/my-tables.js and 1 other location - About 1 hr to fix
                  for-client/my-tables.js on lines 2288..2291

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

                  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

                  Identical blocks of code found in 3 locations. Consider refactoring.
                  Open

                          parameters:[
                              {name:'first_atomic_number', defaultValue:10, typeName:'integer', references:'ptable'},
                              {name:'last_atomic_number' , defaultValue:99, typeName:'integer', references:'ptable'},
                              {name:'group'         , defaultValue:'Actinide', typeName:'text', references:'pgroups'},
                          ],
                  Severity: Major
                  Found in examples/tables/server/procedures-examples.js and 2 other locations - About 1 hr to fix
                  examples/tables/server/procedures-examples.js on lines 22..26
                  examples/tables/server/procedures-examples.js on lines 78..82

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

                  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

                  Identical blocks of code found in 3 locations. Consider refactoring.
                  Open

                          parameters:[
                              {name:'first_atomic_number', defaultValue:10, typeName:'integer', references:'ptable'},
                              {name:'last_atomic_number' , defaultValue:99, typeName:'integer', references:'ptable'},
                              {name:'group'         , defaultValue:'Actinide', typeName:'text', references:'pgroups'},
                          ],
                  Severity: Major
                  Found in examples/tables/server/procedures-examples.js and 2 other locations - About 1 hr to fix
                  examples/tables/server/procedures-examples.js on lines 58..62
                  examples/tables/server/procedures-examples.js on lines 78..82

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

                  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

                  Identical blocks of code found in 3 locations. Consider refactoring.
                  Open

                          parameters:[
                              {name:'first_atomic_number', defaultValue:10, typeName:'integer', references:'ptable'},
                              {name:'last_atomic_number' , defaultValue:99, typeName:'integer', references:'ptable'},
                              {name:'group'         , defaultValue:'Actinide', typeName:'text', references:'pgroups'},
                          ],
                  Severity: Major
                  Found in examples/tables/server/procedures-examples.js and 2 other locations - About 1 hr to fix
                  examples/tables/server/procedures-examples.js on lines 22..26
                  examples/tables/server/procedures-examples.js on lines 58..62

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

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language