rafinskipg/git-changelog

View on GitHub

Showing 11 of 16 total issues

Function exports has 141 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    jshint: {
Severity: Major
Found in Gruntfile.js - About 5 hrs to fix

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

    function writeChangelog(commits) {
      var module = this;
    
      debug('writing change log');
      var sections = this.organizeCommits(commits, this.options.sections);
    Severity: Minor
    Found in tasks/lib/write-change-log.js - About 1 hr to fix

      Function organizeCommit has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

      function organizeCommit(sections, commit) {
        var section = commit.type ? sections[commit.type] : grepSection(sections, commit) ;
        
        var component = commit.component ? commit.component.toLowerCase() : this.emptyComponent;
      
      
      Severity: Minor
      Found in tasks/lib/organize-commits.js - About 1 hr 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 organizeCommits has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function organizeCommits(commits, defaultSections) {
        commits = commits ? commits : [];
      
        var sections = {
          BREAKING : {
      Severity: Minor
      Found in tasks/lib/organize-commits.js - About 1 hr to fix

        Function printCommit has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        function printCommit(commit, printCommitLinks, template) {
          
          const commitLink = format('%s\n  (%s', commit.subject, this.linkToCommit(commit.hash));
          const closes = commit.closes.length ? commit.closes.map(this.linkToIssue, this).join(', ') : '';
          
        Severity: Minor
        Found in tasks/lib/print-commit.js - About 1 hr 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 parseRawCommit has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        function parseRawCommit(raw) {
          debug('parsing raw commit');
          if (!raw) {
            return null;
          }
        Severity: Minor
        Found in tasks/lib/parse-raw-commit.js - About 1 hr 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 parseRawCommit has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function parseRawCommit(raw) {
          debug('parsing raw commit');
          if (!raw) {
            return null;
          }
        Severity: Minor
        Found in tasks/lib/parse-raw-commit.js - About 1 hr to fix

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

          function loadTemplateFile(data) {
          
            this.log('debug','loading template from', this.options.template);
            this.log('debug', 'loading commit template from ', this.options.commit_template);
            const { printCommit, linkToCommit, linkToIssue, options } = this;
          Severity: Minor
          Found in tasks/lib/load-template.js - About 1 hr to fix

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

            function getProviderLinks() {
                debug('getting provider links');
                // This is just in case they differ their urls at some point in the future.
                // Also brings the posibility of adding more providers
                var providerLinks = {
            Severity: Minor
            Found in tasks/lib/get-provider-links.js - About 1 hr to fix

              Function getGitRepoInfo has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              function getGitRepoInfo(initialUrl) {
                const [
                  initial, 
                  protocol, 
                  service, 
              Severity: Minor
              Found in tasks/lib/get-git-repo-info.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 getProviderLinks has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              function getProviderLinks() {
                  debug('getting provider links');
                  // This is just in case they differ their urls at some point in the future.
                  // Also brings the posibility of adding more providers
                  var providerLinks = {
              Severity: Minor
              Found in tasks/lib/get-provider-links.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

              Severity
              Category
              Status
              Source
              Language