codenautas/backend-plus

View on GitHub

Showing 408 of 408 total issues

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

        if(!ldb.wait4detectedFeatures){
            ldb.wait4detectedFeatures = ldb.detectFeatures(db.transaction('$detect',"readwrite").objectStore('$detect'));
        }
Severity: Minor
Found in src/for-client/my-localdb.ts and 1 other location - About 40 mins to fix
src/for-client/my-localdb.ts on lines 218..220

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

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

                sql = `INSERT OR REPLACE INTO `+SqlTools.quoteIdent(tableName)+
                        ` (`+ fieldNames.join(',')+`) values (`+ values.map(_=>'?').join(',')+`);`;
Severity: Minor
Found in src/for-client/my-websqldb.ts and 1 other location - About 40 mins to fix
src/for-client/my-websqldb.ts on lines 317..318

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

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

    async existsStructure(tableName:string):Promise<boolean>{
        var tableDef = await this.getStructure(tableName);
        return tableDef?true:false;
    }
Severity: Minor
Found in src/for-client/my-websqldb.ts and 1 other location - About 40 mins to fix
src/for-client/my-localdb.ts on lines 227..230

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

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(mainDefTable.sql.from && result.row && (!opts || !opts.forImport)){
                //var rowFrom = plainUpdate.values.length?result.row:primaryKeyValueObject;
                var rowFrom = parameters.status!='new' && !plainUpdate.values.length?
                    likeAr.toPlainObject(mainDefTable.primaryKey,expectedMainPrimaryKeyValues):
                    (mainResult||result).row;
Severity: Major
Found in lib/procedures-table.js - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

                if((!mainDefTable || parameters.status!='new') 
                    && (!mainDefTable || parameters.primaryKeyValues.length!=mainDefTable.primaryKey.length)
                    && (parameters.masive && parameters.primaryKeyValues.length>0)
                ){
                    return {masive:true};
    Severity: Major
    Found in lib/procedures-table.js - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

                  if(toCaption == 'labeled' || toCaption != 'alone' && (typeName == 'boolean' || typeName == 'integer' || typeName == 'bigint' || typeName == 'decimal')){
                      captionTitle += grid.def.field[pair.fieldName].title + ':'
                  }
      Severity: Major
      Found in for-client/my-tables.js - About 40 mins to fix

        Consider simplifying this complex logical expression.
        Open

                if(evento.which==13 && !evento.shiftKey  && !evento.ctrlKey  && !evento.altKey  && !evento.metaKey && !this.activeElement.getAttribute("enter-clicks")){ // Enter
                    var enfoco=this.activeElement;
                    var este=this.activeElement;
                    if(enter_hace_tab_en_este_elemento(este)){
                        var no_me_voy_a_colgar=2000;
        Severity: Major
        Found in for-client/my-things.js - About 40 mins to fix

          Consider simplifying this complex logical expression.
          Open

                  if((evento.which==40 || evento.which==38)  && !evento.shiftKey  && !evento.ctrlKey  && !evento.altKey  && !evento.metaKey){ // KeyDown, KeyUp
                      var info=tableInfo(this.activeElement);
                  }
          Severity: Major
          Found in for-client/my-things.js - About 40 mins to fix

            Consider simplifying this complex logical expression.
            Open

                                        if(fieldDef.summary 
                                            && (!fieldDef.summary.types4 || fieldDef.summary.types4.includes(row.data_type))
                                            && (!fieldDef.summary.excludeTypes || !fieldDef.summary.excludeTypes.includes(row.data_type))
                                        ){
                                            var sql=fieldDef.summary.sql|| `select ${(fieldDef.summary.expr)} from $2`;
            Severity: Major
            Found in lib/procedures-table.js - About 40 mins to fix

              Consider simplifying this complex logical expression.
              Open

                  if(elemento.children.length && !noGoDownWhen(proximo)){
                      while(proximo.children.length>0 && no_me_voy_a_colgar-- && !noGoDownWhen(proximo)){
                          proximo=proximo.children[0];
                      }
                      return proximo;
              Severity: Major
              Found in for-client/my-things.js - About 40 mins to fix

                Consider simplifying this complex logical expression.
                Open

                        if((evento.which==40 || evento.which==38)  && !evento.shiftKey  && !evento.ctrlKey  && !evento.altKey  && !evento.metaKey){ // KeyDown, KeyUp
                            var info=tableInfo(this.activeElement);
                            if(info.table){
                                var newPos=info.tr.rowIndex+evento.which-39;
                                var newRow=info.table.rows[newPos];
                Severity: Major
                Found in for-client/my-things.js - About 40 mins to fix

                  Consider simplifying this complex logical expression.
                  Open

                                                      if(be.config.log.db.results || !(type=='ROW' || type=='RESULT' || type=='QUERY-A' || type=='QUERY-P')){
                                                          fs.appendFile('./local-log-all.sql','-- '+(type||'')+'\n'+message+'\n');
                                                      }
                  Severity: Major
                  Found in lib/backend-plus.js - About 40 mins to fix

                    Consider simplifying this complex logical expression.
                    Open

                        if (allTableData) {
                            var prepa = await be.getDataDumpTransformations(allTableData)
                            dataText = [
                                '-- BEGIN DATA FROM DUMP',
                                ...prepa.prepareTransformationSql,
                    Severity: Major
                    Found in lib/backend-plus.js - About 40 mins to fix

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

                                      var sql = "UPDATE "+(be.config.login.schema?be.db.quoteIdent(be.config.login.schema)+'.':'')+
                      Severity: Minor
                      Found in lib/backend-plus.js and 1 other location - About 40 mins to fix
                      lib/backend-plus.js on lines 1005..1008

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

                      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.ActionColumnGrid.prototype.thAgg = function thAgg(){
                          return html.th({class:'th-action'}, this.actionsBottom);
                      };
                      Severity: Minor
                      Found in for-client/my-tables.js and 1 other location - About 40 mins to fix
                      for-client/my-tables.js on lines 875..877

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

                      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

                                                  "SELECT  "+infoFieldList.map(function(fieldOrPair){ return fieldOrPair.split(' as ').map(function(ident){ return be.db.quoteIdent(ident)}).join(' as '); })+
                                                      ", "+be.config.login.activeClausule+" as active "+
                                                      ", "+be.config.login.lockedClausule+" as locked "+
                                                  "  FROM  "+(be.config.login.schema?be.db.quoteIdent(be.config.login.schema)+'.':'')
                      Severity: Minor
                      Found in lib/backend-plus.js and 1 other location - About 40 mins to fix
                      lib/backend-plus.js on lines 1065..1065

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

                      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

                          var sourceFieldList=fk.fields.map(function(pair){ return db.quoteIdent(pair.source); }).join(', ');
                      Severity: Minor
                      Found in lib/backend-plus.js and 1 other location - About 40 mins to fix
                      lib/backend-plus.js on lines 2597..2597

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

                      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

                          var targetFieldList=fk.fields.map(function(pair){ return db.quoteIdent(pair.target); }).join(', ');
                      Severity: Minor
                      Found in lib/backend-plus.js and 1 other location - About 40 mins to fix
                      lib/backend-plus.js on lines 2596..2596

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

                      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

                              for (i=0; i!=s.length; ++i){
                                  buf[i] = s.charCodeAt(i) & 0xFF;
                              }
                      Severity: Minor
                      Found in for-client/my-tables.js and 1 other location - About 40 mins to fix
                      for-client/my-tables.js on lines 1345..1347

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

                      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

                              for (i=0; i!=s.length; ++i){
                                  view[i] = s.charCodeAt(i) & 0xFF;
                              }
                      Severity: Minor
                      Found in for-client/my-tables.js and 1 other location - About 40 mins to fix
                      for-client/my-tables.js on lines 1350..1352

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

                      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