codenautas/backend-plus

View on GitHub
unlogged/my-ajax.js

Summary

Maintainability
F
5 days
Test Coverage

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'){
Severity: Major
Found in unlogged/my-ajax.js - About 1 day to fix

    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;
        }
    Severity: Major
    Found in unlogged/my-ajax.js - About 1 day to fix

      Function readProcedureDefinitions has 89 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      myAjax.readProcedureDefinitions=function readProcedureDefinitions(){
          var my = this;
          var promise;
          var getStored=function(setupOrError){
              if(setupOrError && !(setupOrError instanceof Error) && !setupOrError.isoffline){
      Severity: Major
      Found in unlogged/my-ajax.js - About 3 hrs to fix

        Function defaultInformProgress has 88 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                var defaultInformProgress = function defaultInformProgress(progressInfo){
                    if(progressInfo.message || progressInfo.end || progressInfo.start || progressInfo.loaded){
                        // progressInfo.idGroup
                        if(!divProgress){
                            var idAutoClose='id-auto-close-'+Math.random();
        Severity: Major
        Found in unlogged/my-ajax.js - About 3 hrs to fix

          Function agregar_json has 61 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function agregar_json(div, o, ubicaciones=agregar_json_default_ubicaciones){
              if(o == null){
                  return ;
              }
              if(typeof o == "object" && !(o instanceof Date) && !o.isRealDateTime){
          Severity: Major
          Found in unlogged/my-ajax.js - About 2 hrs to fix

            Avoid deeply nested control flow statements.
            Open

                                    if(titleObject[a] == null){
                                        cellTitle = titleRow.insertCell(-1);
                                        i = cellTitle.cellIndex;
                                        titleObject[a] = i;
                                    }else{
            Severity: Major
            Found in unlogged/my-ajax.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      while(i>=row.cells.length){
                                          row.insertCell(-1);
                                      }
              Severity: Major
              Found in unlogged/my-ajax.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if(cells.title){
                                        if(o instanceof Array && !isNaN(a)){
                                            agregar_class_textInDiv(cells.title, 'row-num', Number(a) + 1); 
                                        }else{
                                            agregar_class_textInDiv(cells.title, 'attr-name', a); 
                Severity: Major
                Found in unlogged/my-ajax.js - About 45 mins to fix

                  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

                  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;
                  Severity: Major
                  Found in unlogged/my-ajax.js and 1 other location - About 7 hrs to fix
                  for-client/my-things.js on lines 17..919

                  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

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  myAjax.setSessionVar = function setSessionVar(varName, value){
                      sessionStorage.setItem(myAjax.getAppPrefix()+varName, JSON4all.stringify(value))
                  }
                  Severity: Minor
                  Found in unlogged/my-ajax.js and 1 other location - About 50 mins to fix
                  unlogged/my-ajax.js on lines 441..443

                  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 51.

                  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

                  myAjax.setLocalVar = function setLocalVar(varName, value){
                      localStorage.setItem(myAjax.getAppPrefix()+varName, JSON4all.stringify(value))
                  }
                  Severity: Minor
                  Found in unlogged/my-ajax.js and 1 other location - About 50 mins to fix
                  unlogged/my-ajax.js on lines 461..463

                  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 51.

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

                      td               :{                   encode:function(x){ return json4all.toUrl(x); }, decode:function(x){ return json4all.parse(x)}  },
                  Severity: Major
                  Found in unlogged/my-ajax.js and 5 other locations - About 45 mins to fix
                  unlogged/my-ajax.js on lines 608..608
                  unlogged/my-ajax.js on lines 609..609
                  unlogged/my-ajax.js on lines 610..610
                  unlogged/my-ajax.js on lines 611..611
                  unlogged/my-ajax.js on lines 622..622

                  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 50.

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

                      ff               :{                   encode:function(x){ return json4all.toUrl(x); }, decode:function(x){ return json4all.parse(x)}  },
                  Severity: Major
                  Found in unlogged/my-ajax.js and 5 other locations - About 45 mins to fix
                  unlogged/my-ajax.js on lines 608..608
                  unlogged/my-ajax.js on lines 610..610
                  unlogged/my-ajax.js on lines 611..611
                  unlogged/my-ajax.js on lines 612..612
                  unlogged/my-ajax.js on lines 622..622

                  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 50.

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

                      pf               :{                   encode:function(x){ return JSON.stringify(x); }, decode:function(x){ return JSON.parse(x)}      },
                  Severity: Major
                  Found in unlogged/my-ajax.js and 5 other locations - About 45 mins to fix
                  unlogged/my-ajax.js on lines 608..608
                  unlogged/my-ajax.js on lines 609..609
                  unlogged/my-ajax.js on lines 610..610
                  unlogged/my-ajax.js on lines 612..612
                  unlogged/my-ajax.js on lines 622..622

                  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 50.

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

                      up               :{                   encode:function(x){ return json4all.toUrl(x); }, decode:function(x){ return json4all.parse(x)}  },
                  Severity: Major
                  Found in unlogged/my-ajax.js and 5 other locations - About 45 mins to fix
                  unlogged/my-ajax.js on lines 608..608
                  unlogged/my-ajax.js on lines 609..609
                  unlogged/my-ajax.js on lines 611..611
                  unlogged/my-ajax.js on lines 612..612
                  unlogged/my-ajax.js on lines 622..622

                  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 50.

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

                      detailing        :{                   encode:function(x){ return json4all.toUrl(x); }, decode:function(x){ return json4all.parse(x)}  },
                  Severity: Major
                  Found in unlogged/my-ajax.js and 5 other locations - About 45 mins to fix
                  unlogged/my-ajax.js on lines 608..608
                  unlogged/my-ajax.js on lines 609..609
                  unlogged/my-ajax.js on lines 610..610
                  unlogged/my-ajax.js on lines 611..611
                  unlogged/my-ajax.js on lines 612..612

                  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 50.

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

                      fc               :{                   encode:function(x){ return json4all.toUrl(x); }, decode:function(x){ return json4all.parse(x)}  },
                  Severity: Major
                  Found in unlogged/my-ajax.js and 5 other locations - About 45 mins to fix
                  unlogged/my-ajax.js on lines 609..609
                  unlogged/my-ajax.js on lines 610..610
                  unlogged/my-ajax.js on lines 611..611
                  unlogged/my-ajax.js on lines 612..612
                  unlogged/my-ajax.js on lines 622..622

                  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 50.

                  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

                  There are no issues that match your filters.

                  Category
                  Status