Showing 408 of 408 total issues
Function MemoryPerodicallySaved
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
function MemoryPerodicallySaved(session){
var MemoryStoreConstructor = memorystore(session);
class MemoryDevelConstructor extends MemoryStoreConstructor{
/**
* @param {memorystore.MemoryConsOpts} opts
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;
}
- 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 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
- 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.TableAggregates.max.prototype.acum=function acum(value){
if(value!=null){
if(this.value==null || this.value<value){
this.value = value;
}
- 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 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
- 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 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?
Function clientIncludes
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
AppBackend.prototype.clientIncludes = function clientIncludes(req, opts) {
const hideBEPlusInclusions = opts === true || opts && typeof opts == "object" && opts.hideBEPlusInclusions;
opts = opts === true ? {} : opts || {};
var list = [];
if (!hideBEPlusInclusions) {
Similar blocks of code found in 2 locations. Consider refactoring. Open
resultTableDef.softForeignKeys.map(function(sfk){
sfk.fields.forEach(function(pair, i, pairs){
if(typeof pair === "string"){
pairs[i] = {source: pair, target: pair};
}
- 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 79.
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
resultTableDef.foreignKeys.map(function(fk){
fk.fields.forEach(function(pair, i, pairs){
if(typeof pair === "string"){
pairs[i] = {source: pair, target: pair};
}
- 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 79.
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 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]];
},
Function presentarAlmacen
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function presentarAlmacen(result, formAMostrar, ordenAMostrar){
formAMostrar = formAMostrar || result.estructura['con-for'][result.id["tipo-abonado"]]["formulario-principal"];
ordenAMostrar = ordenAMostrar || 0;
dropAllChilds(menu_bar);
var botonera=[];
Function constructor
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(opts){
super(opts);
var store=this;
var fileName='sessions/local-sessions.dump';
Promise.resolve().then(function(){
Function processBitacora
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
var processBitacora = async function(hasError, status){
var params = getParams();
var defInsertBitacoraElement = {
procedure_name : procedureDef.action,
parameters: JSON.stringify(params),
Similar blocks of code found in 2 locations. Consider refactoring. Open
be.config.login.plus.newPassPageServe=function(req,res,next){
return MiniTools.serveJade(loginFile.replace(/\blogin\b/,'new-password'),be.optsGenericForFiles(req,{withFlash:true}).jade)(req,res,next);
};
- 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 77.
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
be.config.login.plus.newPassPageServe2=function(req,res,next){
return MiniTools.serveJade(loginFile.replace(/\blogin\b/,'new-password-result'),be.optsGenericForFiles(req,{withFlash:true}).jade)(req,res,next);
};
- 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 77.
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 table
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
myOwn.wScreens.table = function(addrParams){
setTimeout(function(){
var layout = document.getElementById('main_layout');
var opts={tableDef: addrParams.td ?? {}};
if(addrParams.ff){
- 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 start
has a Cognitive Complexity of 16 (exceeds 5 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á
/**
- 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 coreFunction
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
coreFunction:async function(context, parameters){
context.informProgress({message:"start"});
var {be,client} = context;
if (!be.can(context,'DownloadBackup')) {
throw new Error('Forbiden backup')
- 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 clientIncludes
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
AppBackend.prototype.clientIncludes = function clientIncludes(req, opts) {
const hideBEPlusInclusions = opts === true || opts && typeof opts == "object" && opts.hideBEPlusInclusions;
opts = opts === true ? {} : opts || {};
var list = [];
if (!hideBEPlusInclusions) {
- 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 configStaticConfig
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
configStaticConfig(){
super.configStaticConfig();
this.setStaticConfig(`
server:
port: 3033
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){
Function putOneAndGetIfNeeded
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
private async putOneAndGetIfNeeded<T extends Record>(tableName:string, element:T, needed:boolean):Promise<T|void>{
var ldb=this;
var db=await ldb.wait4db
var tableDef=await ldb.getStructure(tableName);
var createPromiseForFK = function createPromiseForFK(fk:ForeignKey){