Showing 24 of 39 total issues
Function afterExecute
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
Open
afterExecute( processedPackages, commandResponses ) {
if ( !processedPackages.size || !commandResponses.size ) {
return;
}
- 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 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function( args, options ) {
const command = getCommandInstance( args[ 0 ] );
if ( !command ) {
return;
Function afterExecute
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
afterExecute( processedPackages, commandResponses ) {
if ( !processedPackages.size || !commandResponses.size ) {
return;
}
Function handleCli
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function handleCli() {
const meowOptions = {
autoHelp: false,
flags: {
version: {
Function execute
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
execute( data ) {
const log = require( '../utils/log' )();
const execCommand = require( './exec' );
if ( !data.isRootRepository ) {
Function exports
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function( args, options ) {
const command = getCommandInstance( args[ 0 ] );
if ( !command ) {
return;
- 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 enqueue
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function enqueue( packageName ) {
if ( processedPackages.has( packageName ) ) {
return;
}
Function gitStatusParser
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function gitStatusParser( branchStatus, currentTag ) {
const responseAsArray = branchStatus.split( '\n' );
const branchData = responseAsArray.shift();
const branch = branchData.split( '...' )[ 0 ].match( /## (.*)$/ )[ 1 ];
Function createSingleRow
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createSingleRow( data ) {
const { packageName, status, commit, mrgitBranch, mrgitTag, latestTag } = data;
const statusColumn = [];
const shouldUseTag = mrgitTag !== undefined;
Function execute
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
execute( data ) {
const log = require( '../utils/log' )();
const execCommand = require( './exec' );
const branch = data.arguments[ 0 ];
Function _clonePackage
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_clonePackage( packageDetails, toolOptions, options ) {
const log = options.log;
return shell( `git clone --progress "${ packageDetails.url }" "${ packageDetails.path }"` )
.then( async output => {
Function getOptions
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function getOptions( callOptions, cwd ) {
const mrgitJsonPath = path.resolve( cwd, 'mrgit.json' );
// Default options.
let options = {
Function createForkPool
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function createForkPool( childPath ) {
const forkPoolFactory = {
create() {
return new Promise( resolve => {
resolve( childProcess.fork( childPath ) );
Function afterExecute
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
afterExecute( parsedPackages, commandResponses, toolOptions ) {
console.log( chalk.cyan( `${ parsedPackages.size } packages have been processed.` ) );
const repositoryResolver = require( toolOptions.resolverPath );
Function log
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function log() {
const logs = new Map( [
[ 'info', [] ],
[ 'error', [] ]
] );
Function execute
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async execute( data ) {
const execCommand = require( './exec' );
let latestTag = null;
let currentTag = null;
Function execute
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
execute( data ) {
const log = require( '../utils/log' )();
const execCommand = require( './exec' );
let promise;
Function afterExecute
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
afterExecute( processedPackages, commandResponses, toolOptions ) {
const cwd = require( '../utils/getcwd' )();
const mrgitJsonPath = path.join( cwd, 'mrgit.json' );
const tagPattern = /@([^ ~^:?*\\]*?)$/;
Function displayLog
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function displayLog( packageName, logs, options ) {
const infoLogs = logs.info.filter( l => l.length ).join( '\n' ).trim();
const errorLogs = logs.error.filter( l => l.length ).join( '\n' ).trim();
const progressPercentage = Math.round( ( options.current / options.all ) * 100 );
Function execute
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
execute( data ) {
const log = require( '../utils/log' )();
const execCommand = require( './exec' );
return execCommand.execute( getExecData( 'git status --branch --porcelain' ) )