Showing 408 of 408 total issues
File backend-plus.js
has 3029 lines of code (exceeds 250 allowed). Consider refactoring. Open
/// <reference path="./in-backend-plus.d.ts" />
"use strict";
var backendPlus = {};
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 */
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;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function dumpDbSchemaPartial
has a Cognitive Complexity of 161 (exceeds 5 allowed). Consider refactoring. Open
AppBackend.prototype.dumpDbSchemaPartial = async function dumpDbSchemaPartial(partialTableStructures, opts = {}){
var complete = opts.complete;
var be = this;
var db=be.db;
db.quoteInteger = function quoteInteger(integerValue){
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File procedures-table.js
has 1256 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @ts-check
"use strict";
var {datetime, changing, coalesce, splitRawRowIntoRow} = require('best-globals');
var XLSX = require('xlsx');
Function start
has 633 lines of code (exceeds 25 allowed). Consider refactoring. Open
AppBackend.prototype.start = function start(opts){
var be = this;
this.getTables().forEach(
// TODO: quitar, no debería hacer falta poner esto acá
/**
Function dumpDbSchemaPartial
has 437 lines of code (exceeds 25 allowed). Consider refactoring. Open
AppBackend.prototype.dumpDbSchemaPartial = async function dumpDbSchemaPartial(partialTableStructures, opts = {}){
var complete = opts.complete;
var be = this;
var db=be.db;
db.quoteInteger = function quoteInteger(integerValue){
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;
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)",
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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)",
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function coreFunction
has 407 lines of code (exceeds 25 allowed). Consider refactoring. Open
coreFunction:async function(context, parameters, files){
var be=context.be;
var doing="opening file";
var skipUnknownFieldsAtImport = coalesce(parameters.skipUnknownFieldsAtImport, be.config.skipUnknownFieldsAtImport);
/** @type {string[]} */
Function coreFunction
has a Cognitive Complexity of 100 (exceeds 5 allowed). Consider refactoring. Open
coreFunction:async function(context, parameters, files, opts){
var be=context.be;
var mainDefTable=be.tableStructures[parameters.table](context);
var action=parameters.status=='new'?'insert':'update';
if(!mainDefTable.allow[action] && (!opts || !opts.forImport)){
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File my-things.js
has 809 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
/// <reference path="../node_modules/types.d.ts/modules/typed-controls/index.d.ts" />
//no/ <reference path="../node_modules/types.d.ts/modules/dialog-promise/index.d.ts" />
/// <reference path="../node_modules/types.d.ts/modules/codenautas-umd/index.d.ts" />
Identical blocks of code found in 2 locations. Consider refactoring. Open
var createPromiseForFK = function createPromiseForFK(fk:ForeignKey){
return Promise.resolve().then(async function(){
var fkTableDef=await ldb.getStructure(fk.references);
if(fkTableDef){
var pk:string[] = [];
- Read upRead up
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 300.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
var createPromiseForFK = function createPromiseForFK(fk:ForeignKey){
return Promise.resolve().then(async function(){
var fkTableDef=await ldb.getStructure(fk.references);
if(fkTableDef){
var pk:string[] = [];
- Read upRead up
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 300.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function addProcedureServices
has 327 lines of code (exceeds 25 allowed). Consider refactoring. Open
AppBackend.prototype.addProcedureServices = function addProcedureServices(forUnlogged){
var be = this;
if(forUnlogged){
var app = express();
}else{
Function tableDefAdapt
has 307 lines of code (exceeds 25 allowed). Consider refactoring. Open
function tableDefAdapt(tableDef, context){
var be = this;
var fieldDomain = be.fieldDomain || {};
if(false && !be.fieldDomain){
throw new Error('lack of fieldDomain in backend. postConfig must call super.postConfig');
Function tableDefAdapt
has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring. Open
function tableDefAdapt(tableDef, context){
var be = this;
var fieldDomain = be.fieldDomain || {};
if(false && !be.fieldDomain){
throw new Error('lack of fieldDomain in backend. postConfig must call super.postConfig');
- Read upRead up
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.TableConnector = function(context, opts){
var connector = this;
for(var attr in context){
connector[attr] = context[attr];
}
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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];
}
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76