MitocGroup/deep-framework

View on GitHub
src/deep-core/lib/Generic/require1k.js

Summary

Maintainability
C
1 day
Test Coverage

Function __deepRequireBrowser__ has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

window.__deepRequireBrowser__ = window.__deepRequireBrowser__ || (function (document, undefined) {
  // Each module has the following properties (shorted to one letter to aid compression)
  // - g: booleany, loadinG, truthy if this module has been requested for loading
  //      before. Used to prevent the same module being loaded twice
  // - l: string, Location, the url location of this module
Severity: Minor
Found in src/deep-core/lib/Generic/require1k.js - About 5 hrs 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 __deepRequireBrowser__ has 99 lines of code (exceeds 25 allowed). Consider refactoring.
Open

window.__deepRequireBrowser__ = window.__deepRequireBrowser__ || (function (document, undefined) {
  // Each module has the following properties (shorted to one letter to aid compression)
  // - g: booleany, loadinG, truthy if this module has been requested for loading
  //      before. Used to prevent the same module being loaded twice
  // - l: string, Location, the url location of this module
Severity: Major
Found in src/deep-core/lib/Generic/require1k.js - About 3 hrs to fix

    Function deepLoad has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function deepLoad(module, callback, parentLocation, id) {
        // If this module is already loading then don't proceed.
        // This is a bug.
        // If a module is requested but not loaded then the module isn't ready,
        // but we callback as if it is. Oh well, 1k!
    Severity: Minor
    Found in src/deep-core/lib/Generic/require1k.js - About 1 hr to fix

      Function onload has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          request.onload = function (deps, count) {
            if (request.status == 200 || module.t) {
              // Should really use an object and then Object.keys to avoid
              // duplicate dependencies. But that costs bytes.
              deps = [];
      Severity: Minor
      Found in src/deep-core/lib/Generic/require1k.js - About 1 hr to fix

        There are no issues that match your filters.

        Category
        Status