codeweaver-pl/svn-release

View on GitHub

Showing 14 of 14 total issues

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

  describe('#status()', function () {
    it('should call svn#status() handle', function () {
      var svnStatus       = chai.spy.on(svn, 'status'),
          svnHelperStatus = new SvnHelper(svn).status();

Severity: Major
Found in test/svn-helper.js and 1 other location - About 4 hrs to fix
test/svn-helper.js on lines 16..26

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

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

  describe('#info()', function () {
    it('should call svn#info() handle', function () {
      var svnInfo       = chai.spy.on(svn, 'info'),
          svnHelperInfo = new SvnHelper(svn).info();

Severity: Major
Found in test/svn-helper.js and 1 other location - About 4 hrs to fix
test/svn-helper.js on lines 28..38

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

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 SvnRelease has 114 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function SvnRelease(config, extSvnHandle) {

  var configObject = normalizeConfig(config),
      svnHelper    = new SvnHelper(extSvnHandle || new Svn(configObject)),
      packageJson  = JSON.parse(fs.readFileSync(configObject.cwd + '/package.json', 'utf8'));
Severity: Major
Found in lib/svn-release.js - About 4 hrs to fix

    Function SvnRelease has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    function SvnRelease(config, extSvnHandle) {
    
      var configObject = normalizeConfig(config),
          svnHelper    = new SvnHelper(extSvnHandle || new Svn(configObject)),
          packageJson  = JSON.parse(fs.readFileSync(configObject.cwd + '/package.json', 'utf8'));
    Severity: Minor
    Found in lib/svn-release.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 copy has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function copy(copyParamsOverrides) {
        return function (repoInfo) {
          var copyOptions = _.extend({
            repoUrl: repoInfo['url'],
            source:  repoInfo['url']
    Severity: Minor
    Found in lib/svn-release.js - About 1 hr to fix

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

        info:   function () {
          var infoHandle = Q.nbind(this.svn.info, this.svn);
          return function () {
            return infoHandle();
          };
      Severity: Minor
      Found in lib/svn-helper.js and 1 other location - About 50 mins to fix
      lib/svn-helper.js on lines 17..22

      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

        status: function () {
          var statusHandle = Q.nbind(this.svn.status, this.svn);
          return function () {
            return statusHandle();
          };
      Severity: Minor
      Found in lib/svn-helper.js and 1 other location - About 50 mins to fix
      lib/svn-helper.js on lines 11..16

      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 6 locations. Consider refactoring.
      Open

        describe('#releaseName', function () {
          it('should return current version', function () {
            expect(svnDefaults.releaseName).to.equal('1.2.3');
          });
        });
      Severity: Major
      Found in test/svn-defaults.js and 5 other locations - About 40 mins to fix
      test/svn-defaults.js on lines 17..22
      test/svn-defaults.js on lines 24..28
      test/svn-defaults.js on lines 36..40
      test/svn-defaults.js on lines 42..46
      test/svn-defaults.js on lines 48..52

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

      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 6 locations. Consider refactoring.
      Open

        describe('#releaseVersion', function () {
          it('should return current version', function () {
            expect(svnDefaults.releaseVersion).to.equal('1.2.3');
          });
        });
      Severity: Major
      Found in test/svn-defaults.js and 5 other locations - About 40 mins to fix
      test/svn-defaults.js on lines 17..22
      test/svn-defaults.js on lines 24..28
      test/svn-defaults.js on lines 30..34
      test/svn-defaults.js on lines 42..46
      test/svn-defaults.js on lines 48..52

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

      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 6 locations. Consider refactoring.
      Open

        describe('#postBranchVersion', function () {
          it('should return minor bump of current version', function () {
            expect(svnDefaults.postBranchVersion).to.equal('1.3.0');
          });
        });
      Severity: Major
      Found in test/svn-defaults.js and 5 other locations - About 40 mins to fix
      test/svn-defaults.js on lines 17..22
      test/svn-defaults.js on lines 24..28
      test/svn-defaults.js on lines 30..34
      test/svn-defaults.js on lines 36..40
      test/svn-defaults.js on lines 42..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 49.

      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 6 locations. Consider refactoring.
      Open

        describe('#branchVersion', function () {
          it('should return current version', function () {
            expect(svnDefaults.branchVersion).to.equal('1.2.3');
          });
        });
      Severity: Major
      Found in test/svn-defaults.js and 5 other locations - About 40 mins to fix
      test/svn-defaults.js on lines 17..22
      test/svn-defaults.js on lines 30..34
      test/svn-defaults.js on lines 36..40
      test/svn-defaults.js on lines 42..46
      test/svn-defaults.js on lines 48..52

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

      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 6 locations. Consider refactoring.
      Open

        describe('#postReleaseVersion', function () {
          it('should return patch bump of current version', function () {
            expect(svnDefaults.postReleaseVersion).to.equal('1.2.4');
          });
        });
      Severity: Major
      Found in test/svn-defaults.js and 5 other locations - About 40 mins to fix
      test/svn-defaults.js on lines 17..22
      test/svn-defaults.js on lines 24..28
      test/svn-defaults.js on lines 30..34
      test/svn-defaults.js on lines 36..40
      test/svn-defaults.js on lines 48..52

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

      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 6 locations. Consider refactoring.
      Open

        describe('#branchName', function () {
      
          it('should return major-minor for current version', function () {
            expect(svnDefaults.branchName).to.equal('1.2');
          });
      Severity: Major
      Found in test/svn-defaults.js and 5 other locations - About 40 mins to fix
      test/svn-defaults.js on lines 24..28
      test/svn-defaults.js on lines 30..34
      test/svn-defaults.js on lines 36..40
      test/svn-defaults.js on lines 42..46
      test/svn-defaults.js on lines 48..52

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

      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 handleDistProcedure has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        this.handleDistProcedure = function (parentPath, targetName, targetVersion, nextVersion, distPath) {
      Severity: Minor
      Found in lib/svn-release.js - About 35 mins to fix
        Severity
        Category
        Status
        Source
        Language