src/deep-core/lib/Generic/require1k.js
Function __deepRequireBrowser__
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
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
- 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 __deepRequireBrowser__
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function deepLoad
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
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!
Function onload
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
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 = [];