Showing 408 of 408 total issues
Similar blocks of code found in 3 locations. Consider refactoring. Open
encIniciar.addEventListener('click',function(){
postAction('blanquear', {id:estado.id,estado:'vacio'}).then(function(res) {
window.location = 'continuar';
});
})
- 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 65.
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 3 locations. Consider refactoring. Open
encContinuar.addEventListener('click', function() {
postAction('set-status', {id:estado.id,estado:'pendiente'}).then(function(res) {
window.location = 'continuar';
});
});
- 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 65.
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
"SELECT 'ok' FROM "+be.db.quoteIdent(defTable.sql.tableName)+
" WHERE "+defTable.primaryKey.map(function(fieldName, i){
return be.db.quoteIdent(fieldName)+" = $"+(i+1+fieldNames4Update.length);
}).join(" AND ")+" ",
- 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 64.
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 createSmartButton
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
myOwn.createSmartButton = function createSmartButton(opts){
var button=opts.button || html.button(opts.buttonProperties||{}, opts.buttonContent||opts.buttonLabel).create();
Object.defineProperty(button, 'smartState', {
get:function(){ return this.getAttribute('smart-button'); },
set:function(value){
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;
Function log
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
myOwn.log = function log(severity, message){
var my=this;
var consoleMessage;
var clientMessage;
if(!message){
Function testCandidateColumnAndAddIt
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
var testCandidateColumnAndAddIt=function testCandidateColumnAndAddIt(fieldName, iColumn, cellAddress){
cellAddress=cellAddress||iColumn;
if(fieldName == "#cuidado"){
inputCuidado = true;
}else if(fieldName && fieldName!='#ignore'){
Function registerStructureInside
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private async registerStructureInside(tableDef:TableDefinition, wait4db:Promise<IDBDatabase>):Promise<{
wait4db:Promise<IDBDatabase>,
result:RegisterResult
}>{
var ldb=this;
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]];
},
- 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 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)
Function createForkeableButton
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
myOwn.createForkeableButton = function createForkeableButton(menu, opts){
var my = this;
if(typeof opts==="string" || opts==null){
opts = {label:opts};
}
Identical blocks of code found in 2 locations. Consider refactoring. Open
function linkButtons(selector, f){
var buttons = document.querySelectorAll(selector);
Array.prototype.forEach.call(buttons, function(button){
button.addEventListener('click', f);
});
- 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 63.
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
function linkButtons(selector, f){
var buttons = document.querySelectorAll(selector);
Array.prototype.forEach.call(buttons, function(button){
button.addEventListener('click', f);
});
- 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 63.
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 exports
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(context){
return context.be.tableDefAdapt({
name:'isotopes',
title:'stable isotopes',
allow:{
Similar blocks of code found in 2 locations. Consider refactoring. Open
if((evento.which==40 || evento.which==38) && !evento.shiftKey && !evento.ctrlKey && !evento.altKey && !evento.metaKey){ // KeyDown, KeyUp
var info=tableInfo(this.activeElement);
}
- 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 62.
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
if((evento.which==40 || evento.which==38) && !evento.shiftKey && !evento.ctrlKey && !evento.altKey && !evento.metaKey){ // KeyDown, KeyUp
var info=tableInfo(this.activeElement);
if(info.table){
var newPos=info.tr.rowIndex+evento.which-39;
var newRow=info.table.rows[newPos];
- 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 62.
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
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
Consider simplifying this complex logical expression. Open
if(defField &&
defField.inTable!==false &&
(defField.allow.import || defField.allow.insert && (defField.allow.update || defField.isPk)) &&
(!defField.clientSide || defField.serverSide)
){
Consider simplifying this complex logical expression. Open
if(evento.which==115 && !evento.shiftKey && !evento.ctrlKey && !evento.altKey && !evento.metaKey){ // F4
/** @type {HTMLElement} */
var activeElement = this.activeElement && this.activeElement.tagName!='BODY' && this.activeElement || document.mayBeRepetibleButton;
var info=tableInfo(activeElement);
if(info.table){
Consider simplifying this complex logical expression. Open
if(config.nodb){
console.log("server without database");
}else{
if(be.config.login["double-dragon"]){
be.DoubleDragon = {dbParams:{}}