codenautas/backend-plus

View on GitHub

Showing 243 of 409 total issues

Function mainPage has 74 lines of code (exceeds 25 allowed). Consider refactoring.
Open

AppBackend.prototype.mainPage = function mainPage(req, offlineMode, opts){
    opts = opts||{};
    if(!opts.icons){
        if(!opts.icon){
            opts.icons={
Severity: Major
Found in lib/backend-plus.js - About 2 hrs to fix

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

            coreFunction:async function(context,parameters){
                var {be} = context;
                var {db} = be;
                var tableName = parameters.table;
                var rows = await be.inTransaction(null, async function(client){
    Severity: Major
    Found in lib/procedures-table.js - About 2 hrs to fix

      Function tipoCeldas has 71 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          tipoCeldas(){
              //var tiposCeldas = {
              return {
                  titulo:{
                      completar: function completar(){
      Severity: Major
      Found in ejemplos/encuesta.js - About 2 hrs to fix

        Function doneFun has 71 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            menuOptions.push({img:my.path.img+'show-hide-columns.png', value:true, label: my.messages.hideOrShow, doneFun:function(){
                dialogPromise(function(dialogWindow, closeWindow){
                    var button=html.button({class:'hide-or-show'},'ok').create();
                    var createSelectElement=function createSelectElement(columns,hideOrShowId,disabledItems){
                        var selectElement=html.select(
        Severity: Major
        Found in for-client/my-tables.js - About 2 hrs to fix

          Function tableGrid has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
          Open

          myOwn.tableGrid = function tableGrid(tableName, mainElement, opts){
              var my = this;
              var grid = new my.TableGrid({my: this}, mainElement);
              opts = opts || {};
              grid.detailingForUrl=opts.detailingForUrl;
          Severity: Minor
          Found in for-client/my-tables.js - About 2 hrs 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 mainPage has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
          Open

          AppBackend.prototype.mainPage = function mainPage(req, offlineMode, opts){
              opts = opts||{};
              if(!opts.icons){
                  if(!opts.icon){
                      opts.icons={
          Severity: Minor
          Found in lib/backend-plus.js - About 2 hrs 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 depotRefresh has 67 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              grid.depotRefresh = function depotRefresh(depot,result,opts){
                  // ¡ATENCIÓN!: esta función no debe despleegar, llama a updateRowData, ahí se despliega
                  opts=opts||{};
                  upadteNumberOfRows(depot,grid);
                  var retrievedRow = result.updatedRow;
          Severity: Major
          Found in for-client/my-tables.js - About 2 hrs to fix

            Function showPage has 67 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            myOwn.showPage = function showPage(pageDef){
                my.prepareFloating3dots();
                var newHash;
                if(!location.hash){
                    newHash=sessionStorage.getItem('backend-plus-hash-redirect');
            Severity: Major
            Found in for-client/my-menu.js - About 2 hrs to fix

              Consider simplifying this complex logical expression.
              Open

                  if(resultTableDef.sql.policies.enabled==null){
                      var pol = resultTableDef.sql.policies;
                      pol.enabled = (
                          pol.all.using || pol.select.using || pol.insert.using || pol.update.using || pol.delete.using ||
                          pol.all.check || pol.select.check || pol.insert.check || pol.update.check || pol.delete.check ||
              Severity: Critical
              Found in lib/table-def-adapt.js - About 2 hrs to fix

                Function createRowElements has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    grid.createRowElements = function createRowElements(iRow, depot){
                        var grid = this;
                        var forInsert = iRow>=0;
                        var tr={};
                        depot.colNumber = null;
                Severity: Major
                Found in for-client/my-tables.js - About 2 hrs to fix

                  Function presentarPlaca has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function presentarPlaca(estado) {
                      agregaLogoAlElemento(pantalla);
                      var textoComienzaEncuesta=estado.estructura.textos.placas['bienvenido-'+estado.estado];
                      var encabezado=textoComienzaEncuesta.encabezado;
                      var parrafos=textoComienzaEncuesta.parrafos;
                  Severity: Major
                  Found in ejemplos/client/index.js - About 2 hrs to fix

                    WebsqlDb has 23 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    export class WebsqlDb{
                        private db:Database;
                        private wait4detectedFeatures:Promise<DetectFeatures>;
                        constructor(public name:string){
                            var version = 1.0;
                    Severity: Minor
                    Found in src/for-client/my-websqldb.ts - About 2 hrs to fix

                      Function BindMemoryPerodicallySaved has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function BindMemoryPerodicallySaved(be){
                          return (
                      /**
                       * @param {Express.Session} session
                       */
                      Severity: Major
                      Found in lib/backend-plus.js - About 2 hrs to fix

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

                                coreFunction:async function(context, parameters){
                                    var be=context.be;
                                    var db=be.db;
                                    var tableDef=be.tableStructures[parameters.table](context);
                                    var tableDefArray = [tableDef].concat(tableDef.offline.details.map(name=>be.tableStructures[name](context)));
                        Severity: Major
                        Found in lib/procedures-table.js - About 2 hrs to fix

                          Function agregar_json has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function agregar_json(div, o, ubicaciones=agregar_json_default_ubicaciones){
                              if(o == null){
                                  return ;
                              }
                              if(typeof o == "object" && !(o instanceof Date) && !o.isRealDateTime){
                          Severity: Major
                          Found in unlogged/my-ajax.js - About 2 hrs to fix

                            Function createRowInsertElements has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                            Open

                            myOwn.TableGrid.prototype.createRowInsertElements = function createRowInsertElements(aboveDepot, belowDepot){
                                var grid = this;
                                if(!belowDepot){
                                    if(aboveDepot){
                                        if(belowDepot=aboveDepot.tr.previousSibling){
                            Severity: Minor
                            Found in for-client/my-tables.js - About 2 hrs 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 prepareGrid has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                            Open

                            myOwn.TableGrid.prototype.prepareGrid = function prepareGrid(){
                                var grid = this;
                                var my = grid.my;
                                grid.view.hiddenColumns=grid.view.hiddenColumns||grid.def.hiddenColumns||[];
                                grid.def.fields.forEach(function(fieldDef){
                            Severity: Minor
                            Found in for-client/my-tables.js - About 2 hrs 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 dialogUpload has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                            Open

                            myOwn.dialogUpload = function dialogUpload(ajaxPath, ajaxParams, ajaxPrepareResultFun, showWithMiniMenu, messages, refresheable, acceptPhotos, optsNames){
                                messages = changing(my.messages, messages||{})
                                optsNames = optsNames || [];
                                var doneFun = function doneFun(){
                                    var fileAttr={class:'import-button',type:'file',style:'min-width:400px'};
                            Severity: Minor
                            Found in for-client/my-tables.js - About 2 hrs 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 MemoryPerodicallySaved has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function MemoryPerodicallySaved(session){
                                var MemoryStoreConstructor = memorystore(session);
                                class MemoryDevelConstructor extends MemoryStoreConstructor{
                                    /**
                                     * @param {memorystore.MemoryConsOpts} opts
                            Severity: Major
                            Found in lib/backend-plus.js - About 2 hrs to fix

                              Function displayRows has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      grid.displayRows = function displayRows(fromRowNumber, toRowNumber, adding){
                                          var grid = this;
                                          if(!adding){
                                              if(grid.vertical){
                                                  // recorrer todos los tr del tbody y dejar solo las primeras columnas?
                              Severity: Major
                              Found in for-client/my-tables.js - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language