Showing 408 of 408 total issues
File my-menu.js
has 630 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
// require('lazy-some').bindToPrototypeIn(Array);
var changing = require('best-globals').changing;
myOwn.wScreens={}
File my-ajax.js
has 611 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
(function codenautasModuleDefinition(root, name, factory) {
/* global define */
/* istanbul ignore next */
if(typeof root.globalModuleName !== 'string'){
Function ajaxPromise
has 227 lines of code (exceeds 25 allowed). Consider refactoring. Open
myAjax.ajaxPromise = function ajaxPromise(procedureDef,data,opts){
opts = opts || {};
if(!('visiblyLogErrors' in opts)){
opts.visiblyLogErrors=true;
}
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){
Function coreFunction
has 211 lines of code (exceeds 25 allowed). Consider refactoring. Open
coreFunction:async function(context, parameters, files, opts){
var be=context.be;
var mainDefTable=be.tableStructures[parameters.table](context);
var action=parameters.status=='new'?'insert':'update';
if(!mainDefTable.allow[action] && (!opts || !opts.forImport)){
Function addUnloggedServices
has 200 lines of code (exceeds 25 allowed). Consider refactoring. Open
AppBackend.prototype.addUnloggedServices = function addUnloggedServices(mainApp, baseUrl){
var be=this;
if(be.config.login.forget?.urlPath){
mainApp.get(Path.posix.join(baseUrl,be.config.login.forget.urlPath), be.config.login.plus.newPassPageServe)
mainApp.get(Path.posix.join(baseUrl,be.config.login.forget.urlPathOk), be.config.login.plus.newPassPageServe2)
Function captureKeys
has 193 lines of code (exceeds 25 allowed). Consider refactoring. Open
myOwn.captureKeys = function captureKeys() {
var previousKey;
var previousPosition;
var my=this;
if(this.captureKeysInstaled){
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={
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=[];
Function presentarFormulario
has 187 lines of code (exceeds 25 allowed). Consider refactoring. Open
function presentarFormulario(result, idFormulario, orden){
var estructuraFormulario=result.estructura.formularios[idFormulario];
var registro;
var almacen=result.almacen;
if(estructuraFormulario.multiple){
Function addLoggedServices
has 184 lines of code (exceeds 25 allowed). Consider refactoring. Open
AppBackend.prototype.addLoggedServices = function addLoggedServices(){
var be = this;
var skin=be.config['client-setup'].skin;
var skinUrl=(skin?skin+'/':'');
var slashSkin=(skin?'/'+skin:'');
Similar blocks of code found in 2 locations. Consider refactoring. Open
server:{
backupNotAvailable: 'Backup not available',
backupReady: 'Backup ready to download',
backupZipping: 'Zipping backup file',
badBackupEncryptKey: 'encrypt key not present or less than 10 characters',
- 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 181.
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
server:{
backupNotAvailable: 'Backup no disponible',
backupReady: 'Archivo listo para bajar',
backupZipping: 'Compactando el backup',
badBackupEncryptKey: 'Debe proveer una clave de encriptacion de 10 caracteres o mas para encriptar el archivo de destino',
- 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 181.
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 exportacionesGenerico
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
AppBackend.prototype.exportacionesGenerico = async function exportacionesGenerico(result, procedureDef, context, params, files){
var {csvFileName, fileName} = procedureDef.forExport
if (!(result instanceof Array)) {
if (!result || !(result instanceof Object)) {
throw new Error ("exportacionesGenerico debe recibir {title:string, rows:Record<string, any>[]}[]")
- 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
(function codenautasModuleDefinition(root, name, factory) {
/* global define */
/* istanbul ignore next */
if(typeof root.globalModuleName !== 'string'){
root.globalModuleName = name;
- 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 180.
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
(function codenautasModuleDefinition(root, name, factory) {
/* global define */
/* istanbul ignore next */
if(typeof root.globalModuleName !== 'string'){
root.globalModuleName = name;
- 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 180.
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 controlar_compatibilidad
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
function controlar_compatibilidad(ya, id, idBoton){
"use strict";
var boton=document.getElementById(idBoton || 'login');
id = id || 'resultado_incompatibilidad';
var div=document.getElementById(id);
- 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 processCoreFunction
has 161 lines of code (exceeds 25 allowed). Consider refactoring. Open
var processCoreFunction = function(){
return Promise.resolve().then(function(){
if(procedureDef.roles && procedureDef.roles.indexOf(req.user[be.config.login.rolFieldName])<0){
throw changing(new Error("Not allowed"), {status:"403"});
}
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 };
- 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
Identical blocks of code found in 2 locations. Consider refactoring. Open
if(aboveCell.getTypedValue){
var value=aboveCell.getTypedValue();
if(info.td.setTypedValue){
info.td.setTypedValue(value, true);
var belowPos=info.tr.rowIndex+1;
- 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 159.
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