jdalrymple/node-hg-plus

View on GitHub

Showing 8 of 8 total issues

Function gitify has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  async gitify(
    {
      path = Path.resolve(Path.dirname(this.path), `${this.name}-git`),
      remoteURL,
      trackAll = false,
Severity: Minor
Found in src/HgRepo.js - About 1 hr to fix

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

    async function cloneMultipleAndMerge(from, to, pythonPath) {
      const mergedRepos = [];
      const combinedRepo = new HgRepo(to, pythonPath);
    
      await Utils.ensureRepoPath(combinedRepo.path);
    Severity: Minor
    Found in src/Hg.js - About 1 hr to fix

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

      async function getSourceInfo(source, pythonPath) {
        let sourceRepoPath;
        let sourceRepoName;
        let sourceURL = null;
      
      
      Severity: Minor
      Found in src/Hg.js - About 1 hr to fix

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

          async pull(
            {
              source = this.url,
              force = false,
              update = false,
        Severity: Minor
        Found in src/HgRepo.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 getSourceInfo has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        async function getSourceInfo(source, pythonPath) {
          let sourceRepoPath;
          let sourceRepoName;
          let sourceURL = null;
        
        
        Severity: Minor
        Found in src/Hg.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 push has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          async push(
            {
              destination = this.url,
              password,
              username,
        Severity: Minor
        Found in src/HgRepo.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 gitify has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

          async gitify(
            {
              path = Path.resolve(Path.dirname(this.path), `${this.name}-git`),
              remoteURL,
              trackAll = false,
        Severity: Minor
        Found in src/HgRepo.js - About 35 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 update has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          async update({ clean = false, check = false, revision, tool, branchOrTag } = {}, done) {
            const optionArgs = [];
        
            if (branchOrTag) optionArgs.push(branchOrTag);
            if (clean) optionArgs.push(' -C');
        Severity: Minor
        Found in src/HgRepo.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