Showing 4 of 4 total issues
Function hgactivity
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function hgactivity(grunt) {
const hasOwnProperty = Object.prototype.hasOwnProperty;
grunt.registerMultiTask('hgactivity', 'Repository activity', function register() {
- 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 hgactivity
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function hgactivity(grunt) {
const hasOwnProperty = Object.prototype.hasOwnProperty;
grunt.registerMultiTask('hgactivity', 'Repository activity', function register() {
Function register
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
grunt.registerMultiTask('hgactivity', 'Repository activity', function register() {
const args = ['activity']; // Command line arguments for 'hg activity'
const dates = []; // Collection of dates used as delimiters of each time span, if interval used
const commands = []; // List of commands that are finally called
Function splitEach
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const splitEach = function splitEach(split) {
const divider = split !== 'none' ?
'_' + split :
'';
const filename = options.filenamePrefix + divider;