azukiapp/azk

View on GitHub
src/manifest/get_project.js

Summary

Maintainability
C
1 day
Test Coverage

File get_project.js has 285 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { path, lazy_require, config, log, fsAsync } from 'azk';
import { async, promiseResolve, promiseReject } from 'azk/utils/promises';
import { UIProxy } from 'azk/cli/ui';
import { matchFirstRegex, matchAllRegex, fulltrim } from 'azk/utils/regex_helper';
import { printOutput } from 'azk/utils/spawn_helper';
Severity: Minor
Found in src/manifest/get_project.js - About 2 hrs to fix

    Function parseCommandOptions has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

      static parseCommandOptions(opts) {
        var is_start      = opts.start;
        var system_name   = opts.system;
        var git_repo      = opts['git-repo'];
        var git_ref       = opts['git-ref'];
    Severity: Minor
    Found in src/manifest/get_project.js - About 2 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 parseCommandOptions has 49 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      static parseCommandOptions(opts) {
        var is_start      = opts.start;
        var system_name   = opts.system;
        var git_repo      = opts['git-repo'];
        var git_ref       = opts['git-ref'];
    Severity: Minor
    Found in src/manifest/get_project.js - About 1 hr to fix

      Function startProject has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        startProject(command_parse_result) {
          return async(this, function* () {
            var force_azk_start_url_endpoint = config('urls:force:endpoints:start');
            this._sendForceAzkStart(command_parse_result, force_azk_start_url_endpoint);
      
      
      Severity: Minor
      Found in src/manifest/get_project.js - About 1 hr to fix

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

          _checkGitError(git_repo, git_branch_tag_commit, git_destination_path) {
            return function (err) {
              var original_error = err.message;
              var stack_trace = err.stack || '';
              var error_type;
        Severity: Minor
        Found in src/manifest/get_project.js - About 1 hr to fix

          There are no issues that match your filters.

          Category
          Status