codenautas/backend-plus

View on GitHub

Showing 242 of 408 total issues

File backend-plus.js has 3029 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/// <reference path="./in-backend-plus.d.ts" />
"use strict";

var backendPlus = {};
Severity: Major
Found in lib/backend-plus.js - About 1 wk to fix

    File my-tables.js has 2997 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    "use strict";
    
    /*global myOwn, my, XLSX, Pikaday  */
    /*global miniMenuPromise, dialogPromise, alertPromise, confirmPromise, promptPromise, simpleFormPromise */
    /*global Blob, document, CustomEvent, URL  */
    Severity: Major
    Found in for-client/my-tables.js - About 1 wk to fix

      Function displayGrid has a Cognitive Complexity of 208 (exceeds 5 allowed). Consider refactoring.
      Open

      myOwn.TableGrid.prototype.displayGrid = function displayGrid(){
          var grid = this;
          var tbody = grid.dom.table.tBodies[0];
          grid.updateRowData = function updateRowData(depot, skipUpdateStatus){
              var grid = this;
      Severity: Minor
      Found in for-client/my-tables.js - About 4 days 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 dumpDbSchemaPartial has a Cognitive Complexity of 161 (exceeds 5 allowed). Consider refactoring.
      Open

      AppBackend.prototype.dumpDbSchemaPartial = async function dumpDbSchemaPartial(partialTableStructures, opts = {}){
          var complete = opts.complete;
          var be = this;
          var db=be.db;
          db.quoteInteger = function quoteInteger(integerValue){
      Severity: Minor
      Found in lib/backend-plus.js - About 3 days 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

      File procedures-table.js has 1256 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      // @ts-check
      "use strict";
      
      var {datetime, changing, coalesce, splitRawRowIntoRow} = require('best-globals');
      var XLSX = require('xlsx');
      Severity: Major
      Found in lib/procedures-table.js - About 3 days to fix

        Function start has 633 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        AppBackend.prototype.start = function start(opts){
            var be = this;
            this.getTables().forEach(
                // TODO: quitar, no debería hacer falta poner esto acá
                /**
        Severity: Major
        Found in lib/backend-plus.js - About 3 days to fix

          Function dumpDbSchemaPartial has 437 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          AppBackend.prototype.dumpDbSchemaPartial = async function dumpDbSchemaPartial(partialTableStructures, opts = {}){
              var complete = opts.complete;
              var be = this;
              var db=be.db;
              db.quoteInteger = function quoteInteger(integerValue){
          Severity: Major
          Found in lib/backend-plus.js - About 2 days to fix

            Function displayGrid has 420 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            myOwn.TableGrid.prototype.displayGrid = function displayGrid(){
                var grid = this;
                var tbody = grid.dom.table.tBodies[0];
                grid.updateRowData = function updateRowData(depot, skipUpdateStatus){
                    var grid = this;
            Severity: Major
            Found in for-client/my-tables.js - About 2 days to fix

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

                      coreFunction:async function(context, parameters, files){
                          var be=context.be;
                          var doing="opening file";
                          var skipUnknownFieldsAtImport = coalesce(parameters.skipUnknownFieldsAtImport, be.config.skipUnknownFieldsAtImport);
                          /** @type {string[]} */
              Severity: Major
              Found in lib/procedures-table.js - About 2 days to fix

                Function coreFunction has a Cognitive Complexity of 100 (exceeds 5 allowed). Consider refactoring.
                Open

                        coreFunction:async function(context, parameters, files, opts){
                            var be=context.be;
                            var mainDefTable=be.tableStructures[parameters.table](context);
                            var action=parameters.status=='new'?'insert':'update';
                            if(!mainDefTable.allow[action] && (!opts || !opts.forImport)){
                Severity: Minor
                Found in lib/procedures-table.js - About 2 days 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

                File my-things.js has 809 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                "use strict";
                
                /// <reference path="../node_modules/types.d.ts/modules/typed-controls/index.d.ts" />
                //no/ <reference path="../node_modules/types.d.ts/modules/dialog-promise/index.d.ts" />
                /// <reference path="../node_modules/types.d.ts/modules/codenautas-umd/index.d.ts" />
                Severity: Major
                Found in for-client/my-things.js - About 1 day to fix

                  Function addProcedureServices has 327 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  AppBackend.prototype.addProcedureServices = function addProcedureServices(forUnlogged){ 
                      var be = this;
                      if(forUnlogged){
                          var app = express();
                      }else{
                  Severity: Major
                  Found in lib/backend-plus.js - About 1 day to fix

                    Function tableDefAdapt has 307 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function tableDefAdapt(tableDef, context){
                        var be = this;
                        var fieldDomain = be.fieldDomain || {};
                        if(false && !be.fieldDomain){
                            throw new Error('lack of fieldDomain in backend. postConfig must call super.postConfig');
                    Severity: Major
                    Found in lib/table-def-adapt.js - About 1 day to fix

                      Function tableDefAdapt has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function tableDefAdapt(tableDef, context){
                          var be = this;
                          var fieldDomain = be.fieldDomain || {};
                          if(false && !be.fieldDomain){
                              throw new Error('lack of fieldDomain in backend. postConfig must call super.postConfig');
                      Severity: Minor
                      Found in lib/table-def-adapt.js - About 1 day 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

                      File my-menu.js has 630 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      "use strict";
                      
                      // require('lazy-some').bindToPrototypeIn(Array);
                      var changing = require('best-globals').changing;
                      myOwn.wScreens={}
                      Severity: Major
                      Found in for-client/my-menu.js - About 1 day to fix

                        File my-ajax.js has 604 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        "use strict";
                        (function codenautasModuleDefinition(root, name, factory) {
                            /* global define */
                            /* istanbul ignore next */
                            if(typeof root.globalModuleName !== 'string'){
                        Severity: Major
                        Found in unlogged/my-ajax.js - About 1 day to fix

                          Function ajaxPromise has 227 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          myAjax.ajaxPromise = function ajaxPromise(procedureDef,data,opts){
                              opts = opts || {};
                              if(!('visiblyLogErrors' in opts)){
                                  opts.visiblyLogErrors=true;
                              }
                          Severity: Major
                          Found in unlogged/my-ajax.js - About 1 day to fix

                            Function prepareGrid has 224 lines of code (exceeds 25 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: Major
                            Found in for-client/my-tables.js - About 1 day to fix

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

                                      coreFunction:async function(context, parameters, files, opts){
                                          var be=context.be;
                                          var mainDefTable=be.tableStructures[parameters.table](context);
                                          var action=parameters.status=='new'?'insert':'update';
                                          if(!mainDefTable.allow[action] && (!opts || !opts.forImport)){
                              Severity: Major
                              Found in lib/procedures-table.js - About 1 day to fix

                                Function addUnloggedServices has 197 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                AppBackend.prototype.addUnloggedServices = function addUnloggedServices(mainApp, baseUrl){
                                    var be=this;
                                    if(be.config.login.forget?.urlPath){
                                        mainApp.get(Path.posix.join(baseUrl,be.config.login.forget.urlPath), be.config.login.plus.newPassPageServe)
                                        mainApp.get(Path.posix.join(baseUrl,be.config.login.forget.urlPathOk), be.config.login.plus.newPassPageServe2)
                                Severity: Major
                                Found in lib/backend-plus.js - About 7 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language