CleverStack/cleverstack-cli

View on GitHub
lib/generator.js

Summary

Maintainability
B
4 hrs
Test Coverage

Function generateRun has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function generateRun(projects, tmpls, names, fn) {
  async.each(
    projects,
    function(project, next) {
      generator.fs
Severity: Minor
Found in lib/generator.js - About 1 hr to fix

    Function generateScaffold has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function generateScaffold(project, name, filterOut, fn) {
      var _path = path.join(__dirname, '..', 'templates', project.name)
        , walk  = require('findit')(_path)
        , dirs  = []
        , files = []
    Severity: Minor
    Found in lib/generator.js - About 1 hr to fix

      Function scaffold has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports.scaffold = function(name, filterOut, fn) {
        name      = Array.isArray(name) ? name : [ name ];
        filterOut = Array.isArray(filterOut) ? filterOut : [];
      
        // Just for easability, we'll add an 's' to the end of the filters to cover a quasi-plural form
      Severity: Minor
      Found in lib/generator.js - About 1 hr to fix

        Function generate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        exports.generate = function(project, tmpls, names, fn) {
          if (arguments.length < 4) {
            fn        = names;
            names     = tmpls;
            tmpls     = project;
        Severity: Minor
        Found in lib/generator.js - About 45 mins 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

        There are no issues that match your filters.

        Category
        Status