chrisenytc/ubauth

View on GitHub

Showing 9 of 16 total issues

Function authorize has 76 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            authorize: (options) => {
                //Build the OAuth consent page URL
                let authWindow = new BrowserWindow({
                    minWidth: 600,
                    minHeight: 835,
Severity: Major
Found in app/src/services/uber.js - About 3 hrs to fix

    Function default has 58 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function (name, options) {
    
        var userDataDir = jetpack.cwd(app.getPath('userData'));
        var stateStoreFile = 'window-state-' + name +'.json';
        var defaultSize = {
    Severity: Major
    Found in app/helpers/window.js - About 2 hrs to fix

      Function signApp has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var signApp = function () {
          var identity = utils.getSigningId(manifest);
          var MASIdentity = utils.getMASSigningId(manifest);
          var MASInstallerIdentity = utils.getMASInstallerSigningId(manifest);
      
      
      Severity: Minor
      Found in tasks/release/osx.js - About 1 hr to fix

        Function createInstaller has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var createInstaller = function () {
            var deferred = Q.defer();
        
            var finalPackageName = utils.getReleasePackageName(manifest) + '.exe';
            var installScript = projectDir.read('resources/windows/installer.nsi');
        Severity: Minor
        Found in tasks/release/windows.js - About 1 hr to fix

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

          var packToDmgFile = function () {
              if (utils.releaseForMAS()) {
                  return new Q();
              }
          
          
          Severity: Minor
          Found in tasks/release/osx.js - About 1 hr to fix

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

                            let getAccessToken = (code) => {
                                let data = {
                                    grant_type: 'authorization_code',
                                    client_id: options.client_id,
                                    client_secret: options.client_secret,
            Severity: Minor
            Found in app/src/services/uber.js - About 1 hr to fix

              Function packToDebFile has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              var packToDebFile = function () {
                  var deferred = Q.defer();
              
                  var debFileName = packName + '.deb';
                  var debPath = releasesDir.path(debFileName);
              Severity: Minor
              Found in tasks/release/linux.js - About 1 hr to fix

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

                var signApp = function () {
                    var identity = utils.getSigningId(manifest);
                    var MASIdentity = utils.getMASSigningId(manifest);
                    var MASInstallerIdentity = utils.getMASInstallerSigningId(manifest);
                
                
                Severity: Minor
                Found in tasks/release/osx.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 default has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                export default function (name, options) {
                
                    var userDataDir = jetpack.cwd(app.getPath('userData'));
                    var stateStoreFile = 'window-state-' + name +'.json';
                    var defaultSize = {
                Severity: Minor
                Found in app/helpers/window.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

                Severity
                Category
                Status
                Source
                Language