Showing 33 of 52 total issues
Function exports
has 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(gulp) {
const fs = require('fs');
const run = require('gulp-run');
const path = require('path');
const mkdirp = require('mkdirp');
Function dependencyReader
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
function dependencyReader(mods) {
var cache = {};
// return the type names that class member depends on
function memberDepends(mem) {
- 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 exports
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(gulp) {
const path = require('path');
const fs = require('fs');
const mkdirp = require('mkdirp');
const async = require('async');
Function dependencyReader
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
function dependencyReader(mods) {
var cache = {};
// return the type names that class member depends on
function memberDepends(mem) {
Function exports
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(gulp) {
const runSequence = require('run-sequence').use(gulp);
const rename = require('gulp-rename');
require('./parse.js')(gulp);
Function exports
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(gulp) {
const render = require('../src/render.js');
const settings = require('../src/settings.js');
const testLib = require('../src/testLib');
Function moduleQuery
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function moduleQuery(mods) {
if (typeof mods === 'string') {
mods = glob.sync(`${mods}/*.json`).map(file =>
JSON.parse(fs.readFileSync(file))
);
- 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 exports
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(gulp) {
const fs = require('fs');
const path = require('path');
const mkdirp = require('mkdirp');
const yargs = require('yargs');
Function moduleQuery
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function moduleQuery(mods) {
if (typeof mods === 'string') {
mods = glob.sync(`${mods}/*.json`).map(file =>
JSON.parse(fs.readFileSync(file))
);
Function classDepends
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function classDepends(cls, options, visited) {
options = options || {};
var firstCall = false;
if (visited === undefined) {
firstCall = true;
Function exports
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(gulp) {
const fs = require('fs');
const run = require('gulp-run');
const path = require('path');
const mkdirp = require('mkdirp');
- 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 processInclude
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function processInclude(decl, parent) {
var newDecl;
if (decl.declarations) {
newDecl = new Conf(decl, parent.name);
newDecl.key = decl.name; //TODO: get rid of .key
- 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 renderHeaders
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function renderHeaders(decl) {
const modules = require('../modules.js')();
var reader = require('../dependencies.js')(modules);
if (decl.declType !== 'module') return false;
Function includeAsStatic
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function includeAsStatic(expr, template, valueFunc, returnType) {
var clsName = expr.split('(')[0];
var cls = headers.get(clsName);
if (!returnType) {
Function renderArgouts
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function renderArgouts(decl) {
if (!decl.arguments)
return false;
var argouts = decl.origArguments.filter(arg => arg.outArg);
Function property
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function property(getter, setter, name) {
this.pushQuery(4, getter, (getMethod) => {
if (getMethod.declType === 'constructor') return false;
if (typeof setter === 'string') {
var setterStr = setter;
Function processInclude
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function processInclude(decl, parent) {
var newDecl;
if (decl.declarations) {
newDecl = new Conf(decl, parent.name);
newDecl.key = decl.name; //TODO: get rid of .key
Function renderObjectOutmap
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function renderObjectOutmap(decl, fullSig) {
var values = decl.origArguments.filter(arg => arg.outArg);
var assignArgs = values
.map((arg, index) => {
Function initialize
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initialize(settings) {
var fileSettings = {};
if (fs.existsSync('settings.json'))
fileSettings = JSON.parse(fs.readFileSync('settings.json'));
Function renderModuleSwig
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function renderModuleSwig(decl, parts) {
if (decl.declType !== 'module')
return false;
function includeIfExists(name) {