codenautas/backend-plus

View on GitHub
for-client/my-tables.js

Summary

Maintainability
F
1 mo
Test Coverage

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

        myOwn.dialogDownload = function dialogDownload(grid){
            return dialogPromise(function(dialogWindow, closeWindow){
                var prepareDownloadElement=html.button({class:'export-a'},my.messages.prepare).create();
                var downloadElement=html.a({class:'export-a'},my.messages.download).create();
                var input={
        Severity: Major
        Found in for-client/my-tables.js - About 7 hrs to fix

          Function prepareMenu has 189 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          myOwn.TableGrid.prototype.prepareMenu = function prepareMenu(button){
              button.src=my.path.img+'menu-dots.png';
              button.title=my.messages.optionsForThisTable;
              var grid=this;
              var menuOptions=[];
          Severity: Major
          Found in for-client/my-tables.js - About 7 hrs to fix

            Function td has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
            Open

            myOwn.DetailColumnGrid.prototype.td = function td(depot, iColumn, tr){
                var grid = this.grid;
                var detailTableDef = this.detailTableDef;
                var detailTableNameAndAbr = this.detailName;
                var detailControl = depot.detailControls[detailTableNameAndAbr] || { show:false };
            Severity: Minor
            Found in for-client/my-tables.js - About 6 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 td has 143 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            myOwn.DetailColumnGrid.prototype.td = function td(depot, iColumn, tr){
                var grid = this.grid;
                var detailTableDef = this.detailTableDef;
                var detailTableNameAndAbr = this.detailName;
                var detailControl = depot.detailControls[detailTableNameAndAbr] || { show:false };
            Severity: Major
            Found in for-client/my-tables.js - About 5 hrs to fix

              Function displayAsDeleted has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
              Open

              myOwn.TableGrid.prototype.displayAsDeleted = function displayAsDeleted(depot, mode){
                  var grid = this;
                  var fast = mode == 'change-ff'
                  if (mode == 'unknown' && myOwn.config.config['grid-row-retain-moved-or-deleted']) {
                      depot.tr.setAttribute('not-here', 'yes'); 
              Severity: Minor
              Found in for-client/my-tables.js - About 5 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 tableGrid has 131 lines of code (exceeds 25 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: Major
              Found in for-client/my-tables.js - About 5 hrs to fix

                Function dialogDownload has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                Open

                myOwn.dialogDownload = function dialogDownload(grid){
                    return dialogPromise(function(dialogWindow, closeWindow){
                        var prepareDownloadElement=html.button({class:'export-a'},my.messages.prepare).create();
                        var downloadElement=html.a({class:'export-a'},my.messages.download).create();
                        var input={
                Severity: Minor
                Found in for-client/my-tables.js - About 4 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 preparing has 112 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    var preparing = grid.prepareAndDisplayGrid().then(function(){
                        if(opts.detailing){
                            grid.depots.forEach(function(depot){
                                var goIntoDetail=opts.detailing[(/^\w/.test(depot.lastsPrimaryKeyValues)?"":"=")+depot.lastsPrimaryKeyValues]||opts.detailing["*"];
                                if(goIntoDetail){
                Severity: Major
                Found in for-client/my-tables.js - About 4 hrs to fix

                  Function dialogUpload has 99 lines of code (exceeds 25 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: Major
                  Found in for-client/my-tables.js - About 3 hrs to fix

                    Function prepareMenu has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                    Open

                    myOwn.TableGrid.prototype.prepareMenu = function prepareMenu(button){
                        button.src=my.path.img+'menu-dots.png';
                        button.title=my.messages.optionsForThisTable;
                        var grid=this;
                        var menuOptions=[];
                    Severity: Minor
                    Found in for-client/my-tables.js - About 3 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 doneFun has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        var doneFun = function doneFun(){
                            var fileAttr={class:'import-button',type:'file',style:'min-width:400px'};
                            if(acceptPhotos){
                                fileAttr.accept='image/*';
                            }
                    Severity: Major
                    Found in for-client/my-tables.js - About 3 hrs to fix

                      Function dialogInput has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          dialogInput:function(typedControl, opts){
                              opts = changing({
                                  reference: {},
                                  extraRow: null
                              },opts ||{});
                      Severity: Major
                      Found in for-client/my-tables.js - About 3 hrs to fix

                        Function refreshAllRows has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                grid.refreshAllRows = async function(force){
                                    var timeStamp = new Date().getTime();
                                    await grid.connector.my.ajax.table_data({
                                        table:grid.connector.tableName,
                                        fixedFields:grid.connector.fixedFields,
                        Severity: Major
                        Found in for-client/my-tables.js - About 3 hrs to fix

                          Function td has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          myOwn.DataColumnGrid.prototype.td = function td(depot, iColumn, tr, saveRow){
                              var grid = this.grid;
                              var fieldDef = this.fieldDef;
                              var forInsert = false; // TODO: Verificar que esto está en desuso
                              var enabledInput=depot.allow.update !== false && grid.def.allow.update /* && !grid.connector.fixedField[fieldDef.name] */ && (forInsert?fieldDef.allow.insert:fieldDef.allow.update);
                          Severity: Major
                          Found in for-client/my-tables.js - About 3 hrs to fix

                            Function displayDetailGrid has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                detailControl.displayDetailGrid = function(opts,event){
                                    var result;
                                    event=event||{};
                                    if(!('fixedFields' in opts)){
                                        opts.fixedFields = calculateFixedFields();
                            Severity: Major
                            Found in for-client/my-tables.js - About 3 hrs to fix

                              Function displayBody has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  grid.displayBody=function displayBody(){
                                      var grid = this;
                                      var depotsToDisplay = grid.filterDepots(grid.depots);
                                      grid.sortDepotsToDisplay = function sortDepotsToDisplay(depotsToDisplay){
                                          if(grid.view.sortColumns.length>0){
                              Severity: Major
                              Found in for-client/my-tables.js - About 3 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 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 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 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 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 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 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

                                        Function getReference has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        myOwn.getReference = function getReference(referenceName, opts){
                                            opts = changing({
                                                getValue: function getValue(row){
                                                    return row[reference.tableDef.primaryKey[reference.tableDef.primaryKey.length-1]];
                                                },
                                        Severity: Major
                                        Found in for-client/my-tables.js - About 2 hrs to fix

                                          Function createRowInsertElements has 52 lines of code (exceeds 25 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: Major
                                          Found in for-client/my-tables.js - About 2 hrs to fix

                                            Function captureKeys has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                                            Open

                                            myOwn.TableGrid.prototype.captureKeys = function captureKeys() {
                                                document.addEventListener('keypress', function(evento){
                                                    return;
                                                    if(evento.which==13){ // Enter
                                                        var enfoco=this.activeElement;
                                            Severity: Minor
                                            Found in for-client/my-tables.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

                                            Function getStructure has 43 lines of code (exceeds 25 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 1 hr to fix

                                              Function populateTableXLS has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                      var populateTableXLS = function populateTableXLS(ws, depots, fieldDefs, topRow, leftColumn){
                                                          topRow=topRow||0;
                                                          leftColumn=leftColumn||0;
                                                          fieldDefs.forEach(function(field,iColumn){
                                                              ws[XLSX.utils.encode_cell({c:iColumn+leftColumn,r:topRow})]={t:'s',v:field.name, s:STYLE_HEADER};
                                              Severity: Minor
                                              Found in for-client/my-tables.js - About 1 hr to fix

                                                Function getData has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                myOwn.TableConnectorLocal.prototype.getData = function getData(){
                                                    var connector = this;
                                                    if(((connector.opts||{}).tableDef||{}).forInsertOnlyMode){
                                                        return Promise.resolve([]);
                                                    }
                                                Severity: Minor
                                                Found in for-client/my-tables.js - About 1 hr to fix

                                                  Function displayAsDeleted has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                                  Open

                                                  myOwn.TableGrid.prototype.displayAsDeleted = function displayAsDeleted(depot, mode){
                                                      var grid = this;
                                                      var fast = mode == 'change-ff'
                                                      if (mode == 'unknown' && myOwn.config.config['grid-row-retain-moved-or-deleted']) {
                                                          depot.tr.setAttribute('not-here', 'yes'); 
                                                  Severity: Minor
                                                  Found in for-client/my-tables.js - About 1 hr to fix

                                                    Function thFilter has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                                    Open

                                                    myOwn.DataColumnGrid.prototype.thFilter = function thFilter(depot, iColumn){
                                                        var grid = this.grid;
                                                        var fieldDef = this.fieldDef;
                                                        var fieldName=fieldDef.name;
                                                        depot.rowSymbols[fieldDef.name]=depot.rowSymbols[fieldDef.name]||'~';
                                                    Severity: Minor
                                                    Found in for-client/my-tables.js - About 1 hr to fix

                                                      Function td has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                                                      Open

                                                      myOwn.DataColumnGrid.prototype.td = function td(depot, iColumn, tr, saveRow){
                                                          var grid = this.grid;
                                                          var fieldDef = this.fieldDef;
                                                          var forInsert = false; // TODO: Verificar que esto está en desuso
                                                          var enabledInput=depot.allow.update !== false && grid.def.allow.update /* && !grid.connector.fixedField[fieldDef.name] */ && (forInsert?fieldDef.allow.insert:fieldDef.allow.update);
                                                      Severity: Minor
                                                      Found in for-client/my-tables.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

                                                      Function cellAttributes has a Cognitive Complexity of 13 (exceeds 5 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

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

                                                              prepare:function(depot, fieldName){
                                                                  depot.rowControls[fieldName].addEventListener('update',function(){
                                                                      var control = this;
                                                                      var valor = control.getTypedValue();
                                                                      if((valor=='B' || valor=='🔑') && "no estaba lockeado"){
                                                      Severity: Minor
                                                      Found in for-client/my-tables.js - About 1 hr to fix

                                                        Function createRowFilter has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                                        Open

                                                            grid.createRowFilter = function createRowFilter(otherRow, filterColumns){
                                                                var grid = this;
                                                                if(!otherRow && grid.hasFilterRow){
                                                                    // return true;
                                                                }
                                                        Severity: Minor
                                                        Found in for-client/my-tables.js - About 1 hr to fix

                                                          Function getStructuresToRegisterInLdb has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                                          Open

                                                          myOwn.getStructuresToRegisterInLdb = function getStructuresToRegisterInLdb(parentTableDef, structuresArray){
                                                              var promiseChain = Promise.resolve();
                                                              structuresArray.push(parentTableDef);
                                                              if(parentTableDef.offline.mode==='master'){
                                                                  parentTableDef.offline.details.forEach(function(tableName){
                                                          Severity: Minor
                                                          Found in for-client/my-tables.js - About 1 hr to fix

                                                            Function excelExport has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                                            Open

                                                                    var excelExport = function(){
                                                                        var wb = XLSX.utils.book_new();
                                                                        var ws = {};
                                                                        var exportFileInformationWs={};
                                                                        var i=0;
                                                            Severity: Minor
                                                            Found in for-client/my-tables.js - About 1 hr to fix

                                                              Function getReference has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                                              Open

                                                              myOwn.getReference = function getReference(referenceName, opts){
                                                                  opts = changing({
                                                                      getValue: function getValue(row){
                                                                          return row[reference.tableDef.primaryKey[reference.tableDef.primaryKey.length-1]];
                                                                      },
                                                              Severity: Minor
                                                              Found in for-client/my-tables.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

                                                              Function prepare has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                                              Open

                                                                      var prepare=function(){
                                                                          mainDiv.setAttribute("current-state", "preparing");
                                                                          setTimeout(function(){
                                                                              fieldsDef2Export=grid.def.fields.filter(function(fieldDef){ 
                                                                                  return (fieldDef.inTable!==false || input.fromOtherTables.checked) 
                                                              Severity: Minor
                                                              Found in for-client/my-tables.js - About 1 hr to fix

                                                                Consider simplifying this complex logical expression.
                                                                Open

                                                                            if(depot.status==='new'){
                                                                                var specialMandatories=grid.def.specialValidator?myOwn.validators[grid.def.specialValidator].getMandatoryMap(depot.row):{};
                                                                                var mandatoryOmitted=function(fieldDef){
                                                                                    return (specialMandatories[fieldDef.name] || fieldDef.nullable!==true && fieldDef.isPk || fieldDef.nullable===false) 
                                                                                        && depot.row[fieldDef.name]==null 
                                                                Severity: Critical
                                                                Found in for-client/my-tables.js - About 1 hr to fix

                                                                  Function saveRow has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                  Open

                                                                      var saveRow = function(depot, opts){
                                                                          if(!('saving' in depot)){
                                                                              depot.saving = Promise.resolve();
                                                                          }
                                                                          changeIoStatus(depot,'updating',depot.rowPendingForUpdate);
                                                                  Severity: Minor
                                                                  Found in for-client/my-tables.js - About 1 hr to fix

                                                                    Function updateRowData has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                    Open

                                                                        grid.updateRowData = function updateRowData(depot, skipUpdateStatus){
                                                                            var grid = this;
                                                                            var forInsert = false; // not define how to detect
                                                                            var tr = depot;
                                                                            grid.setRowStyle(depot,depot.row, skipUpdateStatus);
                                                                    Severity: Minor
                                                                    Found in for-client/my-tables.js - About 1 hr to fix

                                                                      Function prepareAndDisplayGrid has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                      Open

                                                                      myOwn.TableGrid.prototype.prepareAndDisplayGrid = function prepareAndDisplayGrid(){
                                                                          var grid = this;
                                                                          grid.displayPreLoadMessage();
                                                                          var structureRequest = grid.connector.getStructure().then(function(tableDef){
                                                                              grid.def = tableDef;
                                                                      Severity: Minor
                                                                      Found in for-client/my-tables.js - About 1 hr to fix

                                                                        Function next_number has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                                                        Open

                                                                            next_number:function(fieldName, aboveDepot, belowDepot){ 
                                                                                var manager = aboveDepot.manager ?? belowDepot.manager
                                                                                if(!manager){
                                                                                    return 1;
                                                                                }else{
                                                                        Severity: Minor
                                                                        Found in for-client/my-tables.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

                                                                        Function filterDepots has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                        Open

                                                                            grid.filterDepots = function filterDepots(depotsToFilter){
                                                                                var grid = this;
                                                                                var filterRows = grid.view.filter;
                                                                                var depotsToDisplay;
                                                                                if(filterRows && filterRows.length){
                                                                        Severity: Minor
                                                                        Found in for-client/my-tables.js - About 1 hr to fix

                                                                          Function th has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                          Open

                                                                          myOwn.DataColumnGrid.prototype.th = function th(){
                                                                              var fieldDef = this.fieldDef;
                                                                              var grid = this.grid;
                                                                              var th=html.th(this.cellAttributes({class: "th-name", title:fieldDef.description||''}),fieldDef.title).create();
                                                                              if(fieldDef.width){
                                                                          Severity: Minor
                                                                          Found in for-client/my-tables.js - About 1 hr to fix

                                                                            Function refreshAggregates has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                            Open

                                                                            myOwn.TableGrid.prototype.refreshAggregates = function refreshAggregates(){
                                                                                var grid = this;
                                                                                var my = grid.my;
                                                                                var aggData={};
                                                                                grid.def.fields.forEach(function(fieldDef){
                                                                            Severity: Minor
                                                                            Found in for-client/my-tables.js - About 1 hr to fix

                                                                              Function setInheritedFields has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                              Open

                                                                                  grid.setInheritedFields = function(depot, filterFun){
                                                                                      var promiseArray = [];
                                                                                      grid.def.foreignKeys.concat(grid.def.softForeignKeys).filter(filterFun||(x=>x))
                                                                                      .filter(x=>(x.inheritFieldsMode ?? my.config.config['inherit-fields-mode']) != 'no-inherit' ).forEach(function(fkDef){
                                                                                          var fixedFields = fkDef.fields.map(function(field){
                                                                              Severity: Minor
                                                                              Found in for-client/my-tables.js - About 1 hr to fix

                                                                                Function getData has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                Open

                                                                                myOwn.TableConnector.prototype.getData = function getData(){
                                                                                    var connector = this;
                                                                                    if(((connector.opts||{}).tableDef||{}).forInsertOnlyMode){
                                                                                        return Promise.resolve([]);
                                                                                    }
                                                                                Severity: Minor
                                                                                Found in for-client/my-tables.js - About 1 hr to fix

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

                                                                                          menuOptions.push({img:my.path.img+'delete-all-rows.png', value:true, label:my.messages.deleteAllRecords, doneFun:function(){
                                                                                              return confirmPromise(my.messages.confirmDeleteAll+(
                                                                                                  grid.depotsToDisplay.length<grid.depots.length?my.messages.xOverTWillDelete:(
                                                                                                      grid.connector.fixedFields.length?my.messages.allGWillDelete:my.messages.allTWillDelete
                                                                                                  )
                                                                                  Severity: Minor
                                                                                  Found in for-client/my-tables.js - About 1 hr to fix

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

                                                                                          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

                                                                                          Avoid deeply nested control flow statements.
                                                                                          Open

                                                                                                                      if(!isSatisfied){
                                                                                                                          partialOk=false;
                                                                                                                      }
                                                                                          Severity: Major
                                                                                          Found in for-client/my-tables.js - About 45 mins to fix

                                                                                            Avoid deeply nested control flow statements.
                                                                                            Open

                                                                                                                if(depot.detailControls[detailControl].tr){
                                                                                                                    depot.my.fade(depot.detailControls[detailControl].tr, {fast});
                                                                                                                }
                                                                                            Severity: Major
                                                                                            Found in for-client/my-tables.js - About 45 mins to fix

                                                                                              Avoid deeply nested control flow statements.
                                                                                              Open

                                                                                                                              if (force) {
                                                                                                                                  g.dom.main.style.opacity=0.5;
                                                                                                                                  fixedFields = calculateFixedFields()
                                                                                                                                  g.connector.fixedFields = fixedFields
                                                                                                                              }
                                                                                              Severity: Major
                                                                                              Found in for-client/my-tables.js - About 45 mins to fix

                                                                                                Avoid deeply nested control flow statements.
                                                                                                Open

                                                                                                                        if(depot.rowControls[fieldName]){
                                                                                                                            changeIoStatus(depot,'background-change', fieldName);
                                                                                                                            //**VERIFICAR**// */ depot.rowControls[fieldName].setTypedValue(retrievedRow[fieldName]);
                                                                                                                            /*jshint loopfunc: true */
                                                                                                                            setTimeout(function(fieldName){
                                                                                                Severity: Major
                                                                                                Found in for-client/my-tables.js - About 45 mins to fix

                                                                                                  Avoid deeply nested control flow statements.
                                                                                                  Open

                                                                                                                          if(!sameValue(depot.row[fieldName], value)){
                                                                                                                              if(grid.def.field[fieldName].allow.update){
                                                                                                                                  depot.rowPendingForUpdate[fieldName] = value;
                                                                                                                              }
                                                                                                                              depot.row[fieldName] = value;
                                                                                                  Severity: Major
                                                                                                  Found in for-client/my-tables.js - About 45 mins to fix

                                                                                                    Avoid deeply nested control flow statements.
                                                                                                    Open

                                                                                                                            if(whenMergeOverride){
                                                                                                                                depot.row[fieldName] = retrievedRow[fieldName];
                                                                                                                                if(depot.rowControls[fieldName]){
                                                                                                                                    //**VERIFICAR**//  depot.rowControls[fieldName].setTypedValue(retrievedRow[fieldName]);
                                                                                                                                }
                                                                                                    Severity: Major
                                                                                                    Found in for-client/my-tables.js - About 45 mins to fix

                                                                                                      Function sameValue has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                                                                      Open

                                                                                                      function sameValue(a,b){
                                                                                                          return a==b ||
                                                                                                            a instanceof Date && b instanceof Date && a.getTime() == b.getTime() ||
                                                                                                            typeof a === 'number' && (a>MAX_SAFE_INTEGER || a< -MAX_SAFE_INTEGER) && Math.abs(a/b)<1.00000000000001 && Math.abs(a/b)>0.99999999999999 ||
                                                                                                            a && !!a.sameValue && a.sameValue(b);
                                                                                                      Severity: Minor
                                                                                                      Found in for-client/my-tables.js - About 45 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

                                                                                                      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

                                                                                                        Function populateTableXLS has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                        Open

                                                                                                                var populateTableXLS = function populateTableXLS(ws, depots, fieldDefs, topRow, leftColumn){
                                                                                                        Severity: Minor
                                                                                                        Found in for-client/my-tables.js - About 35 mins to fix

                                                                                                          Function refreshAggregates has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                                                          Open

                                                                                                          myOwn.TableGrid.prototype.refreshAggregates = function refreshAggregates(){
                                                                                                              var grid = this;
                                                                                                              var my = grid.my;
                                                                                                              var aggData={};
                                                                                                              grid.def.fields.forEach(function(fieldDef){
                                                                                                          Severity: Minor
                                                                                                          Found in for-client/my-tables.js - About 35 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 prepare has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                                                          Open

                                                                                                                  prepare:function(depot, fieldName){
                                                                                                                      depot.rowControls[fieldName].addEventListener('update',function(){
                                                                                                                          var control = this;
                                                                                                                          var valor = control.getTypedValue();
                                                                                                                          if((valor=='B' || valor=='🔑') && "no estaba lockeado"){
                                                                                                          Severity: Minor
                                                                                                          Found in for-client/my-tables.js - About 35 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 sameMembers has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                          Open

                                                                                                          function sameMembers(a,b){
                                                                                                              for(var attr in a){
                                                                                                                  if(a[attr]!==b[attr]) return false;
                                                                                                              }
                                                                                                              for(var attr in b){
                                                                                                          Severity: Minor
                                                                                                          Found in for-client/my-tables.js - About 25 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 s2ab has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                          Open

                                                                                                          function s2ab(s) {
                                                                                                              var buf;
                                                                                                              var i;
                                                                                                              if(typeof ArrayBuffer !== 'undefined') {
                                                                                                                  buf = new ArrayBuffer(s.length);
                                                                                                          Severity: Minor
                                                                                                          Found in for-client/my-tables.js - About 25 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

                                                                                                          myOwn.i18n.messages.es=changing(myOwn.i18n.messages.es, {
                                                                                                              Delete : "Eliminar",
                                                                                                              Filter : "Filtrar",
                                                                                                              actualValueInDB: "valor actual en la base de datos",
                                                                                                              allGWillDelete: "(se borrarán {$t} registros)",
                                                                                                          Severity: Major
                                                                                                          Found in for-client/my-tables.js and 1 other location - About 2 days to fix
                                                                                                          for-client/my-tables.js on lines 43..111

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

                                                                                                          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=changing(myOwn.i18n.messages.en, {
                                                                                                              Delete : "Delete",
                                                                                                              Filter : "Filter",
                                                                                                              actualValueInDB: "actual value in database",
                                                                                                              allGWillDelete: "({$t} records will be deleted)",
                                                                                                          Severity: Major
                                                                                                          Found in for-client/my-tables.js and 1 other location - About 2 days to fix
                                                                                                          for-client/my-tables.js on lines 113..181

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

                                                                                                          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.TableConnector = function(context, opts){
                                                                                                              var connector = this;
                                                                                                              for(var attr in context){
                                                                                                                  connector[attr] = context[attr];
                                                                                                              }
                                                                                                          Severity: Major
                                                                                                          Found in for-client/my-tables.js and 1 other location - About 1 day to fix
                                                                                                          for-client/my-tables.js on lines 444..463

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

                                                                                                          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.TableConnectorLocal = function(context, opts){
                                                                                                              var connector = this;
                                                                                                              for(var attr in context){
                                                                                                                  connector[attr] = context[attr];
                                                                                                              }
                                                                                                          Severity: Major
                                                                                                          Found in for-client/my-tables.js and 1 other location - About 1 day to fix
                                                                                                          for-client/my-tables.js on lines 289..308

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

                                                                                                          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.TableConnector.prototype.recordEnter = function recordEnter(depot){
                                                                                                              return (!this.my.config.cursor || depot.primaryKeyValues===false?
                                                                                                                  Promise.resolve():
                                                                                                                  depot.my.ajax.table_record_enter({
                                                                                                                      table:depot.def.name, 
                                                                                                          Severity: Major
                                                                                                          Found in for-client/my-tables.js and 1 other location - About 3 hrs to fix
                                                                                                          for-client/my-tables.js on lines 431..439

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

                                                                                                          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.TableConnector.prototype.recordLeave = function recordLeave(depot){
                                                                                                              return (!this.my.config.cursor || depot.primaryKeyValues===false?
                                                                                                                  Promise.resolve():
                                                                                                                  depot.my.ajax.table_record_leave({
                                                                                                                      table:depot.def.name, 
                                                                                                          Severity: Major
                                                                                                          Found in for-client/my-tables.js and 1 other location - About 3 hrs to fix
                                                                                                          for-client/my-tables.js on lines 422..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 108.

                                                                                                          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 4 locations. Consider refactoring.
                                                                                                          Open

                                                                                                                                  if(result.uploaded.skipped==1){
                                                                                                                                      messages.push(my.messages.oneRowSkipped);
                                                                                                                                  }else if(result.uploaded.skipped>1){
                                                                                                                                      messages.push(my.messages.xRowsSkipped.replace('{$x}',result.uploaded.skipped));
                                                                                                                                  }
                                                                                                          Severity: Major
                                                                                                          Found in for-client/my-tables.js and 3 other locations - About 2 hrs to fix
                                                                                                          for-client/my-tables.js on lines 1470..1474
                                                                                                          for-client/my-tables.js on lines 1475..1479
                                                                                                          for-client/my-tables.js on lines 1485..1489

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

                                                                                                          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 4 locations. Consider refactoring.
                                                                                                          Open

                                                                                                                                  if(result.uploaded.updated==1){
                                                                                                                                      messages.push(my.messages.oneRowUpdated);
                                                                                                                                  }else if(result.uploaded.updated>1){
                                                                                                                                      messages.push(my.messages.xRowsUpdated.replace('{$x}',result.uploaded.updated));
                                                                                                                                  }
                                                                                                          Severity: Major
                                                                                                          Found in for-client/my-tables.js and 3 other locations - About 2 hrs to fix
                                                                                                          for-client/my-tables.js on lines 1470..1474
                                                                                                          for-client/my-tables.js on lines 1480..1484
                                                                                                          for-client/my-tables.js on lines 1485..1489

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

                                                                                                          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 4 locations. Consider refactoring.
                                                                                                          Open

                                                                                                                                  if(result.uploaded.inserted==1){
                                                                                                                                      messages.push(my.messages.oneRowInserted);
                                                                                                                                  }else if(result.uploaded.inserted>1){
                                                                                                                                      messages.push(my.messages.xRowsInserted.replace('{$x}',result.uploaded.inserted));
                                                                                                                                  }
                                                                                                          Severity: Major
                                                                                                          Found in for-client/my-tables.js and 3 other locations - About 2 hrs to fix
                                                                                                          for-client/my-tables.js on lines 1475..1479
                                                                                                          for-client/my-tables.js on lines 1480..1484
                                                                                                          for-client/my-tables.js on lines 1485..1489

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

                                                                                                          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 4 locations. Consider refactoring.
                                                                                                          Open

                                                                                                                                  if(result.uploaded.deleted==1){
                                                                                                                                      messages.push(my.messages.oneRowDeleted);
                                                                                                                                  }else if(result.uploaded.deleted>1){
                                                                                                                                      messages.push(my.messages.xRowsDeleted.replace('{$x}',result.uploaded.deleted));
                                                                                                                                  }
                                                                                                          Severity: Major
                                                                                                          Found in for-client/my-tables.js and 3 other locations - About 2 hrs to fix
                                                                                                          for-client/my-tables.js on lines 1470..1474
                                                                                                          for-client/my-tables.js on lines 1475..1479
                                                                                                          for-client/my-tables.js on lines 1480..1484

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

                                                                                                          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 3 locations. Consider refactoring.
                                                                                                          Open

                                                                                                                  buttonCreateFilter=html.button({class:'table-button', 'when-filter':'no', "skip-enter":true}, [
                                                                                                                      html.img({
                                                                                                                          src:my.path.img+'filter.png',
                                                                                                                          alt:'FILTER',
                                                                                                                          title:my.messages.filter
                                                                                                          Severity: Major
                                                                                                          Found in for-client/my-tables.js and 2 other locations - About 2 hrs to fix
                                                                                                          for-client/my-tables.js on lines 2017..2023
                                                                                                          for-client/my-tables.js on lines 2027..2033

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

                                                                                                          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 3 locations. Consider refactoring.
                                                                                                          Open

                                                                                                                  buttonCreateFilterAdd=html.button({class:'table-button', 'when-filter':'yes', "skip-enter":true}, [
                                                                                                                      html.img({
                                                                                                                          src:my.path.img+'filter-line-add.png',
                                                                                                                          alt:'FIL',
                                                                                                                          title:my.messages.filterAdd
                                                                                                          Severity: Major
                                                                                                          Found in for-client/my-tables.js and 2 other locations - About 2 hrs to fix
                                                                                                          for-client/my-tables.js on lines 2007..2013
                                                                                                          for-client/my-tables.js on lines 2027..2033

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

                                                                                                          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 3 locations. Consider refactoring.
                                                                                                          Open

                                                                                                                  buttonDestroyFilter=html.button({class:'table-button', 'when-filter':'yes', "skip-enter":true}, [
                                                                                                                      html.img({
                                                                                                                          src:my.path.img+'destroy-filter.png',
                                                                                                                          alt:'FILTER OFF',
                                                                                                                          title:my.messages.filterOff
                                                                                                          Severity: Major
                                                                                                          Found in for-client/my-tables.js and 2 other locations - About 2 hrs to fix
                                                                                                          for-client/my-tables.js on lines 2007..2013
                                                                                                          for-client/my-tables.js on lines 2017..2023

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

                                                                                                          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.TableAggregates.min.prototype.acum=function acum(value){
                                                                                                              if(value!=null){
                                                                                                                  if(this.value==null || this.value>value){
                                                                                                                      this.value = value;
                                                                                                                  }
                                                                                                          Severity: Major
                                                                                                          Found in for-client/my-tables.js and 1 other location - About 2 hrs to fix
                                                                                                          for-client/my-tables.js on lines 1909..1915

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

                                                                                                          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.TableAggregates.max.prototype.acum=function acum(value){
                                                                                                              if(value!=null){
                                                                                                                  if(this.value==null || this.value<value){
                                                                                                                      this.value = value;
                                                                                                                  }
                                                                                                          Severity: Major
                                                                                                          Found in for-client/my-tables.js and 1 other location - About 2 hrs to fix
                                                                                                          for-client/my-tables.js on lines 1897..1903

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

                                                                                                          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.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 2 locations. Consider refactoring.
                                                                                                          Open

                                                                                                                          if(!rows.length){
                                                                                                                              grid.dom.caption.textContent=my.messages.thereAreNot+': '+grid.dom.caption.textContent;
                                                                                                                              grid.dom.table.setAttribute('error-list','no-errors');
                                                                                                                          }else{
                                                                                                                              grid.dom.table.setAttribute('error-list','have-errors');
                                                                                                          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 1953..1959

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

                                                                                                          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

                                                                                                                  depot.my.ajax.table_record_delete({
                                                                                                                      table:depot.def.name, 
                                                                                                                      primaryKeyValues:depot.primaryKeyValues,
                                                                                                                      launcher:opts.launcher
                                                                                                                  }).then(function(){
                                                                                                          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 532..537

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

                                                                                                          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

                                                                                                                      if(!grid.depotsToDisplay.length){
                                                                                                                          grid.dom.caption.textContent=my.messages.thereAreNot+': '+grid.dom.caption.textContent;
                                                                                                                          grid.dom.table.setAttribute('error-list','no-errors');
                                                                                                                      }else{
                                                                                                                          grid.dom.table.setAttribute('error-list','have-errors');
                                                                                                          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 819..825

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

                                                                                                          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

                                                                                                                  db[depot.def.name].delete(depot.primaryKeyValues).then(function(){
                                                                                                                      depot._isDeleted=true;
                                                                                                                      depot.tr.dispatchEvent(new CustomEvent('deletedRowOk'));
                                                                                                                      var grid=depot.manager;
                                                                                                                      grid.dom.main.dispatchEvent(new CustomEvent('deletedRowOk'));
                                                                                                          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 390..399

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

                                                                                                          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

                                                                                                                      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

                                                                                                                      grid.view.sortColumns=grid.view.sortColumns.filter(function(sortColumn){
                                                                                                                          return sortColumn.column != fieldDef.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 2080..2082

                                                                                                          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

                                                                                                                      exportFileInformationWs[XLSX.utils.encode_cell({c:1,r:  i})]={t:'s',v:my.config.username};
                                                                                                          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 1722..1722

                                                                                                          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 3 locations. Consider refactoring.
                                                                                                          Open

                                                                                                                      exportFileInformationWs[XLSX.utils.encode_cell({c:0,r:++i})]={t:'s',v:'user',s:STYLE_HEADER};
                                                                                                          Severity: Major
                                                                                                          Found in for-client/my-tables.js and 2 other locations - About 50 mins to fix
                                                                                                          for-client/my-tables.js on lines 1721..1721
                                                                                                          for-client/my-tables.js on lines 1723..1723

                                                                                                          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

                                                                                                                  grid.modes.withColumnDetails=grid.def.fields.some(function(fieldDef){ 
                                                                                                                      return fieldDef.label!=fieldDef.title; 
                                                                                                                  });
                                                                                                          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 993..995

                                                                                                          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 3 locations. Consider refactoring.
                                                                                                          Open

                                                                                                                      exportFileInformationWs[XLSX.utils.encode_cell({c:0,r:++i})]={t:'s',v:'table',s:STYLE_HEADER};
                                                                                                          Severity: Major
                                                                                                          Found in for-client/my-tables.js and 2 other locations - About 50 mins to fix
                                                                                                          for-client/my-tables.js on lines 1723..1723
                                                                                                          for-client/my-tables.js on lines 1725..1725

                                                                                                          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 3 locations. Consider refactoring.
                                                                                                          Open

                                                                                                                      exportFileInformationWs[XLSX.utils.encode_cell({c:0,r:++i})]={t:'s',v:'date',s:STYLE_HEADER};
                                                                                                          Severity: Major
                                                                                                          Found in for-client/my-tables.js and 2 other locations - About 50 mins to fix
                                                                                                          for-client/my-tables.js on lines 1721..1721
                                                                                                          for-client/my-tables.js on lines 1725..1725

                                                                                                          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

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

                                                                                                                          grid.modes.withColumnDetails?html.tr(grid.columns.map(function(column){ return column.thDetail(); })):null,
                                                                                                          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 2130..2130

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

                                                                                                          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

                                                                                                                                  grid.modes.withColumnDetails?html.tr(grid.columns.map(function(column){ return column.thDetail(); })):null
                                                                                                          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 2153..2153

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

                                                                                                          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

                                                                                                                      filterColumns.forEach(function(filterColumn){
                                                                                                                          depot.row[filterColumn.column]=filterColumn.value;
                                                                                                                          depot.rowSymbols[filterColumn.column]=filterColumn.operator;
                                                                                                                      });
                                                                                                          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 2256..2259

                                                                                                          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

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

                                                                                                                  if(!pair.range && grid.def.field[pair.fieldName].inTable !== false){
                                                                                                                      depotForInsert.row[pair.fieldName] = pair.value;
                                                                                                                      depotForInsert.rowPendingForUpdate[pair.fieldName] = pair.value;
                                                                                                                  }
                                                                                                          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 2624..2627

                                                                                                          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

                                                                                                          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

                                                                                                                  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

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

                                                                                                          myOwn.ActionColumnGrid.prototype.th = function th(){
                                                                                                              return html.th({class:'grid-th-actions'}, this.actions);
                                                                                                          };
                                                                                                          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 931..933

                                                                                                          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

                                                                                                                                  }else if(result.uploaded.skippedColumns.length>1){
                                                                                                                                      messages.push(my.messages.skippedColumns+": "+result.uploaded.skippedColumns.join(', '));
                                                                                                                                  }
                                                                                                          Severity: Minor
                                                                                                          Found in for-client/my-tables.js and 1 other location - About 35 mins to fix
                                                                                                          for-client/my-tables.js on lines 1490..1494

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

                                                                                                          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

                                                                                                                                  if(result.uploaded.skippedColumns.length==1){
                                                                                                                                      messages.push(my.messages.skippedColumn+": "+result.uploaded.skippedColumns.join(', '));
                                                                                                                                  }else if(result.uploaded.skippedColumns.length>1){
                                                                                                                                      messages.push(my.messages.skippedColumns+": "+result.uploaded.skippedColumns.join(', '));
                                                                                                                                  }
                                                                                                          Severity: Minor
                                                                                                          Found in for-client/my-tables.js and 1 other location - About 35 mins to fix
                                                                                                          for-client/my-tables.js on lines 1492..1494

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

                                                                                                          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 (var i = oldSortSpans.length; i > 0; i--) {
                                                                                                                  oldSortSpans[i-1].remove();
                                                                                                              }
                                                                                                          Severity: Minor
                                                                                                          Found in for-client/my-tables.js and 1 other location - About 30 mins to fix
                                                                                                          for-client/my-tables.js on lines 786..788

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

                                                                                                          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 (var i = oldSortImgs.length; i > 0; i--) {
                                                                                                                  oldSortImgs[i-1].remove();
                                                                                                              }
                                                                                                          Severity: Minor
                                                                                                          Found in for-client/my-tables.js and 1 other location - About 30 mins to fix
                                                                                                          for-client/my-tables.js on lines 789..791

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

                                                                                                          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

                                                                                                          There are no issues that match your filters.

                                                                                                          Category
                                                                                                          Status