paazmaya/grunt-image-profile

View on GitHub

Showing 4 of 4 total issues

Function image_profile has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function image_profile(grunt) {

  grunt.registerMultiTask('image_profile', 'Working with image metadata profiles via ImageMagick', function register() {

    const done = this.async();
Severity: Minor
Found in tasks/image_profile.js - About 5 hrs to fix

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 image_profile has 87 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function image_profile(grunt) {

  grunt.registerMultiTask('image_profile', 'Working with image metadata profiles via ImageMagick', function register() {

    const done = this.async();
Severity: Major
Found in tasks/image_profile.js - About 3 hrs to fix

    Function register has 85 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      grunt.registerMultiTask('image_profile', 'Working with image metadata profiles via ImageMagick', function register() {
    
        const done = this.async();
        const commands = [];
        const options = this.options({
    Severity: Major
    Found in tasks/image_profile.js - About 3 hrs to fix

      Function gruntConf has 53 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = function gruntConf(grunt) {
        require('time-grunt')(grunt); // Must be first item
        require('jit-grunt')(grunt);
      
        // Project configuration.
      Severity: Major
      Found in Gruntfile.js - About 2 hrs to fix
        Severity
        Category
        Status
        Source
        Language