Showing 28 of 51 total issues
File utils.js
has 347 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*globals define*/
"use strict";
const childProcess = require("child_process");
const spawn = childProcess.exec;
Function getRequireJSPaths
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var getRequireJSPaths = function (config, startPath) {
var componentTypes = Object.keys(config.dependencies),
components,
paths = [],
names,
File ComponentManager.js
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*globals define*/
/*
* This is the basic structure for component managers
*
* In the component manager, all public functions (functions not preceded by a _)
Function new
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
SeedManager.prototype.new = function (args, callback) {
var gmeConfigPath = utils.getGMEConfigPath(),
gmeConfig = require(gmeConfigPath),
projectName = args.project,
name = (args.seedName || projectName).replace(/\.js(on)?$/, ""),
Function import
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
webgme.all.import = function (projectName, opts, callback) {
let rootPath;
opts = opts || {};
return Q()
Function init
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
BaseManager.prototype.init = function (args, callback) {
// Create new project
var project, name, err;
project = path.resolve(args.name || process.cwd());
Function dockerize
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
DockerizeManager.prototype.dockerize = function (args) {
utils.changeToRootDir();
const tempToFileInfo = [];
let outfiles = OUT_FILES.DEFAULT;
Function new
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
PluginManager.prototype.new = function (options, callback) {
// Set the config options from the command line flags
var self = this,
config = this._parseConfig(options),
pluginGenerator = new PluginGenerator(this._logger, config);
Function new
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
SeedManager.prototype.new = function (args, callback) {
var gmeConfigPath = utils.getGMEConfigPath(),
gmeConfig = require(gmeConfigPath),
projectName = args.project,
name = (args.seedName || projectName).replace(/\.js(on)?$/, ""),
- 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 createSubCommands
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
var createSubCommands = function (dir, defArgs, descTs, opts) {
var components = getSupportedSubCommands(dir),
componentNames = {},
program,
inferrable,
- 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 rm
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ComponentManager.prototype.rm = function (args, callback) {
var name = args.name,
config = utils.getConfig(),
type =
config.components[this._group][name] !== undefined
Function createSubCommands
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var createSubCommands = function (dir, defArgs, descTs, opts) {
var components = getSupportedSubCommands(dir),
componentNames = {},
program,
inferrable,
Function getWebGMEConfigContent
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var getWebGMEConfigContent = function (startPath) {
var arrays,
config = getConfig(startPath),
paths = {},
categories = ["components", "dependencies"],
Function _createPkgJson
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
BaseManager.prototype._createPkgJson = function (project, name) {
var pkgJsonTemplatePath = path.join(
__dirname,
"res",
"package.template.json"
Function _getJsonForConfig
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ComponentManager.prototype._getJsonForConfig = function (
installInfo,
callback
) {
var self = this;
Function new
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
VisualizerManager.prototype.new = function (options, callback) {
// Set the config options from the command line flags
var self = this,
visualizerGenerator = new VisualizerGenerator(this._logger, options),
id = options.visualizerID,
Function _invokePlugin
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Enableable.prototype._invokePlugin = function (args, action, callback) {
if (!(args.name && args.project)) {
this._logger.error(
"Usage: webgme " +
action +
Function import
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
VisualizerManager.prototype.import = function (options, callback) {
var self = this;
ComponentManager.prototype.import.call(this, options, function (err, result) {
if (err) {
return callback(err);
Function mount
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
RouterManager.prototype.mount = function (options, callback) {
var config = utils.getConfig(),
routerName = options.name,
mountPt = options.mountPt,
types = Object.keys(config),
Function updateWebGMEConfig
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var updateWebGMEConfig = function (startPath) {
var root = getRootPath(startPath),
content = getWebGMEConfigContent(startPath),
templatePath = path.join(__dirname, "res", "config.template.js.ejs"),
template = _.template(fs.readFileSync(templatePath)),