codenautas/backend-plus

View on GitHub

Showing 408 of 408 total issues

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

        if(!be.config.login.forget?.urlPath){
            be.config.login.forget.urlPath = '/new-pass';
        }
Severity: Minor
Found in lib/backend-plus.js and 1 other location - About 40 mins to fix
lib/backend-plus.js on lines 1228..1230

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

        if(!be.config.login.forget?.urlPathOk){
            be.config.login.forget.urlPathOk = '/new-pass-ok';
        }
Severity: Minor
Found in lib/backend-plus.js and 1 other location - About 40 mins to fix
lib/backend-plus.js on lines 1225..1227

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

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 passwordChanger has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

                be.passwordChanger=function(req, username, oldPassword, newPassword, done) {
    Severity: Minor
    Found in lib/backend-plus.js - About 35 mins to fix

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

      AppBackend.prototype.exportacionesGenerico = async function exportacionesGenerico(result, procedureDef, context, params, files){
      Severity: Minor
      Found in lib/backend-plus.js - About 35 mins to fix

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

                if(tableDef.foreignKeys){
                    tableDef.foreignKeys.forEach(async function(fk){
                        promisesArray.push(createPromiseForFK(fk));
                    });
                }
        Severity: Major
        Found in src/for-client/my-websqldb.ts and 3 other locations - About 35 mins to fix
        src/for-client/my-localdb.ts on lines 328..332
        src/for-client/my-localdb.ts on lines 333..337
        src/for-client/my-websqldb.ts on lines 302..306

        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

                            var {row} = await client.query(`select *
                                from tokens
                                where tokentype = 'new-pass' and token = $1
                                    and due > $2
                                limit 1;
        Severity: Minor
        Found in lib/backend-plus.js and 1 other location - About 35 mins to fix
        lib/backend-plus.js on lines 1896..1901

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

                if(tableDef.softForeignKeys){
                    tableDef.softForeignKeys.forEach(async function(fk){
                        promisesArray.push(createPromiseForFK(fk));
                    });
                }
        Severity: Major
        Found in src/for-client/my-localdb.ts and 3 other locations - About 35 mins to fix
        src/for-client/my-localdb.ts on lines 328..332
        src/for-client/my-websqldb.ts on lines 297..301
        src/for-client/my-websqldb.ts on lines 302..306

        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

                        var {row} = await client.query(`select *
                            from tokens
                            where tokentype = 'new-pass' and token = $1
                                and $2 < due
                            limit 1;
        Severity: Minor
        Found in lib/backend-plus.js and 1 other location - About 35 mins to fix
        lib/backend-plus.js on lines 1867..1872

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

                if(tableDef.foreignKeys){
                    tableDef.foreignKeys.forEach(async function(fk){
                        promisesArray.push(createPromiseForFK(fk));
                    });
                }
        Severity: Major
        Found in src/for-client/my-localdb.ts and 3 other locations - About 35 mins to fix
        src/for-client/my-localdb.ts on lines 333..337
        src/for-client/my-websqldb.ts on lines 297..301
        src/for-client/my-websqldb.ts on lines 302..306

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

                if(tableDef.softForeignKeys){
                    tableDef.softForeignKeys.forEach(async function(fk){
                        promisesArray.push(createPromiseForFK(fk));
                    });
                }
        Severity: Major
        Found in src/for-client/my-websqldb.ts and 3 other locations - About 35 mins to fix
        src/for-client/my-localdb.ts on lines 328..332
        src/for-client/my-localdb.ts on lines 333..337
        src/for-client/my-websqldb.ts on lines 297..301

        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

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

        function updateOnlineStatus(){
            if(window.my){
                var networkLight=document.getElementById('light-network-signal');
                var skin=((my.config||{}).config||{}).skin;
                if(networkLight){
        Severity: Minor
        Found in for-client/my-menu.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 codenautasModuleDefinition has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        (function codenautasModuleDefinition(root, name, factory) {
            /* global define */
            /* istanbul ignore next */
            if(typeof root.globalModuleName !== 'string'){
                root.globalModuleName = name;
        Severity: Minor
        Found in for-client/my-things.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 changeOfflineMode has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        myOwn.changeOfflineMode = function changeOfflineMode(){
            my.offline.mode=!my.offline.mode;
            my.offlineModeRefresh();
            my.setOnlineOfflineUrl();
            if(my.offline.mode){
        Severity: Minor
        Found in for-client/my-menu.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 codenautasModuleDefinition has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        (function codenautasModuleDefinition(root, name, factory) {
            /* global define */
            /* istanbul ignore next */
            if(typeof root.globalModuleName !== 'string'){
                root.globalModuleName = name;
        Severity: Minor
        Found in unlogged/my-ajax.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 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

        Severity
        Category
        Status
        Source
        Language