500tech/angular-kick

View on GitHub

Showing 22 of 37 total issues

Function exports has 92 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function (name, noController, abstract) {
  name = Utils.ensureName('state', name);

  const stateList = name.split('/');
  const rootState = Format.toFolderName(stateList.shift());
Severity: Major
Found in lib/generators/state.js - About 3 hrs to fix

    exports has 28 functions (exceeds 20 allowed). Consider refactoring.
    Open

    module.exports = class Templates {
    
      static directive(locals /* { directiveName } */) {
        return angularTemplate('directive', locals);
      }
    Severity: Minor
    Found in lib/templates.js - About 3 hrs to fix

      Function generateState has 70 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function generateState (stateName) {
          const parents             = stateName.split('.');
          const stateControllerName = Format.toConstName(stateName);
          stateName                 = Format.toFolderName(parents.pop());
          const statePath           = Format.parentPath(parents) + stateName + '/';
      Severity: Major
      Found in lib/generators/state.js - About 2 hrs to fix

        Function exports has 64 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function (name) {
          name = Utils.ensureName('state', name);
        
          const parentStates  = name.split('/');
          const rootState     = Format.toFolderName(parentStates.shift());
        Severity: Major
        Found in lib/destroyers/state.js - About 2 hrs to fix

          Function exports has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

          module.exports = function (name, noController, abstract) {
            name = Utils.ensureName('state', name);
          
            const stateList = name.split('/');
            const rootState = Format.toFolderName(stateList.shift());
          Severity: Minor
          Found in lib/generators/state.js - About 1 hr 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 exports has 46 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports = function () {
            const type = process.argv[3];
            const name = process.argv[4];
          
            process.argv.splice(0,5);
          Severity: Minor
          Found in lib/commands/generate.js - About 1 hr to fix

            Function destroyState has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function destroyState (stateName) {
                const parents             = stateName.split('.');
                const stateControllerName = Format.toConstName(stateName);
                stateName                 = Format.toFolderName(parents.pop());
                const statePath           = Format.parentPath(parents) + stateName + '/';
            Severity: Minor
            Found in lib/destroyers/state.js - About 1 hr to fix

              Function exports has 43 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              module.exports = function () {
                const type = process.argv[3];
                const name = process.argv[4];
              
                process.argv.splice(0,5);
              Severity: Minor
              Found in lib/commands/destroy.js - About 1 hr to fix

                Function exports has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                module.exports = (config) => {
                  config.set({
                    basePath: '',
                
                    plugins: [
                Severity: Minor
                Found in templates/angular/app/karma.conf.js - About 1 hr to fix

                  Function exports has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  module.exports = function () {
                    let appName = Format.toConstName(process.argv[3]);
                    let noSetup = (process.argv[4] || '').toLowerCase();
                  
                    noSetup = (noSetup === '--no-setup' || noSetup === '-ns');
                  Severity: Minor
                  Found in lib/commands/new.js - About 1 hr to fix

                    Function exports has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    module.exports = function () {
                      const term = process.argv[3];
                    
                      switch (term) {
                        case 'about':
                    Severity: Minor
                    Found in lib/commands/help.js - About 1 hr to fix

                      Function exports has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      module.exports = function (name, template) {
                        name = Utils.ensureName('directive', name);
                      
                        let subdirectories = name.split('/');
                        name = subdirectories.pop();
                      Severity: Minor
                      Found in lib/generators/directive.js - About 1 hr to fix

                        Function exports has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        module.exports = function () {
                          Logger.log(message.upgrade.checking);
                        
                          http.get('http://registry.npmjs.org/kick/latest', (response) => {
                            let body = '';
                        Severity: Minor
                        Found in lib/commands/upgrade.js - About 1 hr to fix

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

                          module.exports = function (name, controller) {
                            name = Utils.ensureName('partial', name);
                          
                            let parentStates = name.split('/');
                            name = parentStates.pop();
                          Severity: Minor
                          Found in lib/generators/partial.js - About 1 hr to fix

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

                            module.exports = function (name, options) {
                              name = Utils.ensureName('model', name);
                            
                              let subdirectories = name.split('/');
                              name = subdirectories.pop();
                            Severity: Minor
                            Found in lib/generators/model.js - About 1 hr to fix

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

                              module.exports = function (name, options) {
                                name = Utils.ensureName('service', name);
                              
                                let subdirectories = name.split('/');
                                name = subdirectories.pop();
                              Severity: Minor
                              Found in lib/generators/service.js - About 1 hr to fix

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

                                function runServer(port) {
                                  const environment = process.argv[3] || 'development';
                                  const args        = ['--hot', '--progress', '--port', port];
                                  let command       = 'node_modules/.bin/webpack-dev-server';
                                
                                
                                Severity: Minor
                                Found in lib/commands/start.js - About 1 hr to fix

                                  Function generate has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  function generate() {
                                    Logger.log(message.help.definition('generate', 'g'));
                                    Logger.log('Creates the following types:'.white);
                                    Logger.log(' – directive'.yellow);
                                    Logger.log('   Will be created in /app/directives directory');
                                  Severity: Minor
                                  Found in lib/commands/help.js - About 1 hr to fix

                                    Function exports has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    module.exports = function (name) {
                                      name = Utils.ensureName('component', name);
                                    
                                      let subdirectories = name.split('/');
                                      name = subdirectories.pop();
                                    Severity: Minor
                                    Found in lib/generators/component.js - About 1 hr to fix

                                      Function link has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          link(scope, element, attrs, ctrl, $transclude) {
                                      Severity: Minor
                                      Found in templates/angular/app/app/directives/if-env.js - About 35 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language