arboleya/electrify

View on GitHub

Showing 15 of 32 total issues

Function Env has 89 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function Env(input, output, settings, cli) {
  // shortcuts
  var join = path.join;

  // electrify version
Severity: Major
Found in lib/env.js - About 3 hrs to fix

    Function Env has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

    function Env(input, output, settings, cli) {
      // shortcuts
      var join = path.join;
    
      // electrify version
    Severity: Minor
    Found in lib/env.js - About 3 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 start has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    MongoDB.prototype.start = function(done) {
    
      // in development mode, when app is not inside elctron, mongodb is just not
      // needed, since meteor itself is already running its own mongodb
      if(!this.$.env.app.is_packaged) {
    Severity: Minor
    Found in lib/plugins/mongodb.js - About 1 hr to fix

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

      Electron.prototype.package = function(packager_options, done) {
      
        var packager = require('electron-packager');
      
        // fetches electron version from core temp folder
      Severity: Minor
      Found in lib/electron.js - About 1 hr to fix

        Function Socket has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function Socket($, logger){
          this.$ = $;
          this.log = require('../log')($, 'electrify:plugins:socket');
          
          this.name = 'socket';
        Severity: Minor
        Found in lib/plugins/socket.js - About 1 hr to fix

          Function parse_packager_options has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function parse_packager_options(){
            var names = [
              '--icon',
              '--app-bundle-id',
              '--app-version',
          Severity: Minor
          Found in bin/cli.js - About 1 hr to fix

            Function prepare has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            Scaffold.prototype.prepare = function() {
            
              this.log.info('ensuring basic structure');
              
              shell.mkdir('-p' , this.$.env.app.bin);
            Severity: Minor
            Found in lib/scaffold.js - About 1 hr to fix

              Function electrify has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function electrify(create) {
                var input;
              
                // validates input dir (app-root folder)
                if(program.input && !fs.existsSync(program.input)) {
              Severity: Minor
              Found in bin/cli.js - About 1 hr to fix

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

                target.setup = function() {
                  log('setting up everything for development');
                
                  // list folder paths
                  var parent       = path.join(__dirname, '..');
                Severity: Minor
                Found in make.js - About 1 hr to fix

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

                  function connect(port){
                  
                    if(!port) {
                      log([
                        'cannot initialize connection. Did you `npm install -g electrify`?',
                  Severity: Minor
                  Found in meteor/index.js - About 1 hr to fix

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

                    App.prototype.bundle_meteor = function( /* server_url, */ done) {
                      this.log.info('bundling meteor');
                    
                      var tmp_dir             = join(this.$.env.core.tmp, 'bundling');
                      var bundled_dir         = join(tmp_dir, 'bundle');
                    Severity: Minor
                    Found in lib/app.js - About 1 hr to fix

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

                      App.prototype.ensure_deps = function(done) {
                      
                        this.log.info('ensuring electrify dependencies');
                        
                        var npm_cmd = 'npm' + (this.$.env.os.is_windows ? '.cmd' : '');
                      Severity: Minor
                      Found in lib/app.js - About 1 hr to fix

                        Function electrify has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function electrify(create) {
                          var input;
                        
                          // validates input dir (app-root folder)
                          if(program.input && !fs.existsSync(program.input)) {
                        Severity: Minor
                        Found in bin/cli.js - About 55 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

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

                        App.prototype.ensure_deps = function(done) {
                        
                          this.log.info('ensuring electrify dependencies');
                          
                          var npm_cmd = 'npm' + (this.$.env.os.is_windows ? '.cmd' : '');
                        Severity: Minor
                        Found in lib/app.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

                        Function parse_meteor_settings has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function parse_meteor_settings(return_path_only) {
                          if(!program.settings)
                            return (return_path_only ? null : {});
                        
                          var relative = join(process.cwd(), program.settings);
                        Severity: Minor
                        Found in bin/cli.js - About 25 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

                        Severity
                        Category
                        Status
                        Source
                        Language