rafinskipg/git-changelog

View on GitHub

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

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

                    customTemplate: {
                      options: {
                        app_name : 'Custom Template',
                        intro: 'This changelog is generated with a custom template',
                        file: 'output/customTemplate.md',
              Severity: Minor
              Found in Gruntfile.js and 1 other location - About 50 mins to fix
              Gruntfile.js on lines 76..87

              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 52.

              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

                    customCommitTemplate: {
                      options: {
                        app_name : 'Custom Commit Template',
                        intro: 'This changelog is generated with a custom commit template',
                        file: 'output/customCommitTemplate.md',
              Severity: Minor
              Found in Gruntfile.js and 1 other location - About 50 mins to fix
              Gruntfile.js on lines 64..75

              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 52.

              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

                      gitlab: {
                          issue: '[#%s](' + this.options.repo_url + '/issues/%s)',
                          commit: '[%s](' + this.options.repo_url + '/commit/%s)'
                      }
              Severity: Minor
              Found in tasks/lib/get-provider-links.js and 2 other locations - About 40 mins to fix
              tasks/lib/get-provider-links.js on lines 10..13
              tasks/lib/get-provider-links.js on lines 14..17

              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 48.

              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

                      github: {
                          issue: '[#%s](' + this.options.repo_url + '/issues/%s)',
                          commit: '[%s](' + this.options.repo_url + '/commit/%s)'
                      },
              Severity: Minor
              Found in tasks/lib/get-provider-links.js and 2 other locations - About 40 mins to fix
              tasks/lib/get-provider-links.js on lines 14..17
              tasks/lib/get-provider-links.js on lines 18..21

              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 48.

              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

                      bitbucket: {
                          issue: '[#%s](' + this.options.repo_url + '/issues/%s)',
                          commit: '[%s](' + this.options.repo_url + '/commits/%s)'
                      },
              Severity: Minor
              Found in tasks/lib/get-provider-links.js and 2 other locations - About 40 mins to fix
              tasks/lib/get-provider-links.js on lines 10..13
              tasks/lib/get-provider-links.js on lines 18..21

              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 48.

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