chrisenytc/ubauth

View on GitHub

Showing 16 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

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

    var packageBuiltApp = function () {
        var deferred = Q.defer();
    
        asar.createPackageWithOptions(projectDir.path('build'), finalAppDir.path('Contents/Resources/app.asar'), {
            dot: true
    Severity: Major
    Found in tasks/release/osx.js and 2 other locations - About 2 hrs to fix
    tasks/release/linux.js on lines 34..44
    tasks/release/windows.js on lines 34..44

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 84.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

    var packageBuiltApp = function () {
        var deferred = Q.defer();
    
        asar.createPackageWithOptions(projectDir.path('build'), readyAppDir.path('resources/app.asar'), {
            dot: true
    Severity: Major
    Found in tasks/release/windows.js and 2 other locations - About 2 hrs to fix
    tasks/release/linux.js on lines 34..44
    tasks/release/osx.js on lines 36..46

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 84.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

    var packageBuiltApp = function () {
        var deferred = Q.defer();
    
        asar.createPackageWithOptions(projectDir.path('build'), readyAppDir.path('resources/app.asar'), {
            dot: true
    Severity: Major
    Found in tasks/release/linux.js and 2 other locations - About 2 hrs to fix
    tasks/release/osx.js on lines 36..46
    tasks/release/windows.js on lines 34..44

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 84.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    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

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            return init()
                .then(copyRuntime)
                .then(cleanupRuntime)
                .then(packageBuiltApp)
                .then(finalize)
        Severity: Major
        Found in tasks/release/osx.js and 1 other location - About 1 hr to fix
        tasks/release/windows.js on lines 127..135

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 65.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            return init()
                .then(copyRuntime)
                .then(cleanupRuntime)
                .then(packageBuiltApp)
                .then(finalize)
        Severity: Major
        Found in tasks/release/windows.js and 1 other location - About 1 hr to fix
        tasks/release/osx.js on lines 187..195

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 65.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        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

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            module.exports.getMASSigningId = function (manifest) {
                return argv['mas-sign'] || (manifest.osx.codeSignIdentitiy ? manifest.osx.codeSignIdentitiy.MAS : undefined);
            };
            Severity: Major
            Found in tasks/utils.js and 1 other location - About 1 hr to fix
            tasks/utils.js on lines 49..51

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 58.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            module.exports.getMASInstallerSigningId = function (manifest) {
                return argv['mas-installer-sign'] || (manifest.osx.codeSignIdentitiy ? manifest.osx.codeSignIdentitiy.MASInstaller : undefined);
            };
            Severity: Major
            Found in tasks/utils.js and 1 other location - About 1 hr to fix
            tasks/utils.js on lines 45..47

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 58.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            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