Showing 11 of 25 total issues
Function exports
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(config, overrides, callback) {
const name = basename(config, extname(config));
debug('name', name);
const dir = resolve(process.cwd(), dirname(config));
debug('dir', dir);
Function create_travis_yml
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
function create_travis_yml(gh_token) {
return new Promise(function(resolve, reject) {
// This builds the yaml in memory including the secure token and writes the file
// It could also use a moustache style template in integration/travis/.travis.yml
Function exports
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(config, overrides, callback) {
const name = basename(config, extname(config));
debug('name', name);
const dir = resolve(process.cwd(), dirname(config));
debug('dir', dir);
- 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
File docsmith-install.js
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env node
/**
* Module dependencies.
*/
Function npm_build
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
function npm_build(src, dest) {
const load_npm_build_yaml = new Promise(function(resolve) {
resolve(yaml.safeLoad(fs.readFileSync(path.join(templates.path, src), 'utf8')));
});
Function init
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function init(template = 'metalsmith') {
// Built in templates
if (template == 'jekyll' || template == 'metalsmith') {
try {
debug('template file', path.join(templates_path, 'init-' + template));
Function init
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function init(template = 'metalsmith') {
// Built in templates
if (template == 'jekyll' || template == 'metalsmith') {
try {
debug('template file', path.join(templates_path, 'init-' + template));
Function read_package_json
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const read_package_json = function(yaml) {
const check_package_json = new Promise(function(resolve, reject) {
fs.stat(dest, function(err, stats) {
if (err) {
resolve(false);
Function deploy
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const deploy = function deploy(workspaces, repository, done) {
debug('workspaces', workspaces);
debug('repository', repository);
debug('pwd', process.cwd());
async.reduce(
Function npm_build
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function npm_build(src, dest) {
const load_npm_build_yaml = new Promise(function(resolve) {
resolve(yaml.safeLoad(fs.readFileSync(path.join(templates.path, src), 'utf8')));
});
- 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 start
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function start({
workspace,
config,
link = false,
source,
- 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"