examples/requirejs/js/lib/require.js
Showing 19 of 19 total issues
Function newContext
has 925 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function newContext(contextName) { var inCheckLoaded, Module, context, handlers, checkLoadedTimeoutId, config = { waitSeconds: 7,
File require.js
has 1232 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/** vim: et:ts=4:sw=4:sts=4 * @license RequireJS 2.0.6 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. * see: http://github.com/jrburke/requirejs for details */
Function callPlugin
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
callPlugin: function () { var map = this.map, id = map.id, pluginMap = makeModuleMap(map.prefix, null, false, true);
Function check
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
check: function (silent) { if (!this.enabled || this.enabling) { return; }
Function checkLoaded
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function checkLoaded() { var map, modId, err, usingPathFallback, waitInterval = config.waitSeconds * 1000, //It is possible to disable the wait interval by using waitSeconds of 0. expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(),
Function normalize
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function normalize(name, baseName, applyMap) { var pkgName, pkgConfig, mapValue, nameParts, i, j, nameSegment, foundMap, foundI, foundStarMap, starI, baseParts = baseName && baseName.split('/'), normalizedBaseParts = baseParts,
Function configure
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
configure: function (cfg) { //Make sure the baseUrl ends in a slash. if (cfg.baseUrl) { if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== '/') { cfg.baseUrl += '/';
Function makeModuleMap
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) { var url, pluginModule, suffix, index = name ? name.indexOf('!') : -1, prefix = null, parentName = parentModuleMap ? parentModuleMap.name : null,
Function enable
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
enable: function () { this.enabled = true; if (!this.waitPushed) { waitAry.push(this);
Function require
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
require: function (deps, callback, errback, relMap) { var moduleName, id, map, requireMod, args; if (typeof deps === 'string') { if (isFunction(callback)) { //Invalid call
Function nameToUrl
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
nameToUrl: function (moduleName, ext) { var paths, pkgs, pkg, pkgPath, syms, i, parentModule, url, parentPath; //If a colon is in the URL, it indicates a protocol is used and it is just
Function completeLoad
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
completeLoad: function (moduleName) { var found, args, mod, shim = config.shim[moduleName] || {}, shExports = shim.exports && shim.exports.exports;
Function load
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
req.load = function (context, moduleName, url) { var config = (context && context.config) || {}, node; if (isBrowser) { //In the browser so use a script tag
Function forceExec
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function forceExec(mod, traced, uninited) { var id = mod.map.id, depArray = mod.depMaps; if (!mod.inited || !mod.map.isDefine) {
Avoid deeply nested control flow statements. Open
Open
if (moduleName === pkg.name) { pkgPath = pkg.location + '/' + pkg.main; } else { pkgPath = pkg.location; }
Avoid deeply nested control flow statements. Open
Open
if (mapValue) { mapValue = mapValue[nameSegment]; if (mapValue) { //Match, update name to the new value. foundMap = mapValue;
Avoid deeply nested control flow statements. Open
Open
if (cjsModule && cjsModule.exports !== undefined && //Make sure it is not already the exports value cjsModule.exports !== this.exports) { exports = cjsModule.exports;
Avoid too many return
statements within this function. Open
Open
return context.require;
Avoid too many return
statements within this function. Open
Open
return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + args[args.length - 1]));