iframely/lib/loader/pluginLoader.js
File pluginLoader.js
has 364 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
(function(pluginLoader) {
var fs = require('fs'),
path = require('path'),
_ = require('underscore'),
Function loadPluginFile
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function loadPluginFile(pluginPath) {
var bits = pluginPath.split(path.sep);
if (pluginPath.match(/\.js$/i)) {
Function scanModulesForPlugins
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function scanModulesForPlugins() {
// Scan node_modules dir.
var modulesRootPath = path.resolve('node_modules');
var modules_listing = fs.readdirSync(modulesRootPath).map(function(module_name) { return path.resolve(modulesRootPath, module_name); });
Function getPluginMethods
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getPluginMethods(pluginPath,plugin) {
var methods = {};
for (var name in plugin) {
var func = plugin[name];
if (typeof func === "function" && PLUGIN_METHODS.indexOf(name) > -1) {
Avoid deeply nested control flow statements. Open
Open
if (error) {
console.error(error.reason);
if (error.evidence) {
console.error(error.evidence+'\n');
}
Avoid too many return
statements within this function. Open
Open
return;
Avoid too many return
statements within this function. Open
Open
return;
Avoid too many return
statements within this function. Open
Open
return;
Avoid too many return
statements within this function. Open
Open
return;
Avoid too many return
statements within this function. Open
Open
return;