codenautas/backend-plus

View on GitHub

Showing 408 of 408 total issues

Function saving has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        depot.saving = depot.saving.then(function(){
            if(!Object.keys(depot.rowPendingForUpdate).length){
                return Promise.resolve();
            }
            if(depot.status==='new'){
Severity: Minor
Found in for-client/my-tables.js - About 1 hr to fix

    Function getMenu has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        getMenu(context){
            return {menu:[
                {menuType:'menu', name:'periodic_table', menuContent:[
                    {menuType:'table', name:'ptable'  , label:'elements'},
                    {menuType:'table', name:'pgroups' , label:'groups'  },
    Severity: Minor
    Found in examples/tables/server/server-tables.js - About 1 hr to fix

      Function cellAttributes has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      myOwn.DataColumnGrid.prototype.cellAttributes = function cellAttributes(specificAttributes,opts){
          var fieldDef = this.fieldDef;
          var grid=this.grid;
          var opts=opts||{};
          var attr=changing({"my-colname":fieldDef.name},specificAttributes);
      Severity: Minor
      Found in for-client/my-tables.js - About 1 hr to fix

        Function complements has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                            function complements(fieldDef){
                                if(fieldDef.sequence && !fieldDef.sequence.name){
                                    tablesWithStrictSequence[tableName]={}
                                }
                                if(fieldDef.typeName==='text' && !fieldDef.allowEmptyText){
        Severity: Minor
        Found in lib/backend-plus.js - About 1 hr to fix

          Function promise has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      var promise = be.inDbClient(req, async (client)=>{
                          var now = bestGlobals.datetime.now();
                          var {row} = await client.query(`select *
                              from tokens
                              where tokentype = 'new-pass' and token = $1
          Severity: Minor
          Found in lib/backend-plus.js - About 1 hr to fix

            Function detectFeatures has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                async detectFeatures(store:IDBObjectStore):Promise<DetectFeatures>{
                    return new Promise<DetectFeatures>((resolve) => {
                        try{
                            // @ts-ignore
                            var os: string = window.myOwn.config.useragent.os;
            Severity: Minor
            Found in src/for-client/my-localdb.ts - About 1 hr to fix

              Function deleteOneRow has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          var deleteOneRow=function(row){
                              //return Promise.resolve().then(function(){
                              //    row.
                              var dataParams=[];
                              var whereParts=[];
              Severity: Minor
              Found in lib/procedures-table.js - About 1 hr to fix

                Function coreFunction has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        coreFunction:function(context, parameters){
                            var be=context.be;
                            var defTable=be.tableStructures['cursors'](context);
                            var otherFields={username:context.username, machineId:context.machineId, navigator: context.navigator, since:new Date()};
                            var fieldNames=[];
                Severity: Minor
                Found in lib/procedures-table.js - About 1 hr to fix

                  Function coreFunction has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          coreFunction:function(context, parameters){
                              var be=context.be;
                              var defTable=be.tableStructures[parameters.table](context);
                              if(!defTable.allow.delete){
                                  throw changing(new Error("Deletes not allowed"),{status:403});
                  Severity: Minor
                  Found in lib/procedures-table.js - About 1 hr to fix

                    Function dialogUpload has 8 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    myOwn.dialogUpload = function dialogUpload(ajaxPath, ajaxParams, ajaxPrepareResultFun, showWithMiniMenu, messages, refresheable, acceptPhotos, optsNames){
                    Severity: Major
                    Found in for-client/my-tables.js - About 1 hr to fix

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

                          defNewElement=changing(defNewElement,{
                              name:'new_element',
                              tableName:'ptable',
                              elementName:'new element',
                              forInsertOnlyMode:true,
                      Severity: Major
                      Found in examples/tables/server/table-new_element.js and 1 other location - About 1 hr to fix
                      examples/tables/server/table-new_isotopes.js on lines 8..15

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

                      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

                          defNewElement=changing(defNewElement,{
                              name:'new_isotopes',
                              tableName:'isotopes',
                              elementName:'new isotope',
                              forInsertOnlyMode:true,
                      Severity: Major
                      Found in examples/tables/server/table-new_isotopes.js and 1 other location - About 1 hr to fix
                      examples/tables/server/table-new_element.js on lines 8..15

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

                      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

                                  my.light('network-signal', function(){
                                      alertPromise(
                                          my.messages.networkSignal1.replace('$1',this.result.status),
                                          {underElement:this}
                                      );
                      Severity: Minor
                      Found in for-client/my-menu.js and 1 other location - About 55 mins to fix
                      for-client/my-menu.js on lines 425..430

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

                      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

                                  my.light('server', function(){
                                      alertPromise(
                                          my.messages.speed1.replace('$1',this.result.speed),
                                          {underElement:this}
                                      );
                      Severity: Minor
                      Found in for-client/my-menu.js and 1 other location - About 55 mins to fix
                      for-client/my-menu.js on lines 431..436

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

                      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 displayMainMenu has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                      myOwn.displayMainMenu = function(addrParams){
                          if(window.currentAutofrefresh){
                              console.log("borro currentAutoRefresh")
                              clearInterval(window.currentAutofrefresh);
                              window.currentAutofrefresh=null;
                      Severity: Minor
                      Found in for-client/my-menu.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 getStructure has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                      myOwn.TableConnector.prototype.getStructure = function getStructure(opts){
                          var opts = changing({
                              registerInLocalDB: false, 
                              waitForFreshStructure: false 
                          }, opts || {});
                      Severity: Minor
                      Found in for-client/my-tables.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 forInsertOnly has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                      tableDefAdapt.forInsertOnly = function forInsertOnly(tableDef){
                          if(tableDef.forInsertOnlyMode){
                              tableDef.field = likeAr(tableDef.field).filter(function(fieldDef){
                                  return fieldDef.orderForInsertOnly;
                              });
                      Severity: Minor
                      Found in lib/table-def-adapt.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 dumpFkConstraint has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                      AppBackend.prototype.dumpFkConstraint = function dumpFkConstraint(fk, tableDef, forced){
                          var db=this.db;
                          var sourceFieldList=fk.fields.map(function(pair){ return db.quoteIdent(pair.source); }).join(', ');
                          var targetFieldList=fk.fields.map(function(pair){ return db.quoteIdent(pair.target); }).join(', ');
                          var consName=db.quoteIdent(fk.consName?fk.consName:(tableDef.alias||tableDef.sql.tableName)+' '+(fk.alias||fk.references)+' REL');
                      Severity: Minor
                      Found in lib/backend-plus.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

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

                                  exportFileInformationWs[XLSX.utils.encode_cell({c:1,r:  i})]={t:'s',v:grid.def.name};
                      Severity: Minor
                      Found in for-client/my-tables.js and 1 other location - About 50 mins to fix
                      for-client/my-tables.js on lines 1726..1726

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

                      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

                                  otherColumns.push(`(${(pol.enabled && (pol.update.using || pol.all.using) || 'true' )}) is true as "$allow.update"`);
                      Severity: Minor
                      Found in lib/table-def-adapt.js and 1 other location - About 50 mins to fix
                      lib/table-def-adapt.js on lines 237..237

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

                      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