tcorral/mystiquex

View on GitHub

Showing 27 of 27 total issues

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

function checkGitFsRepo(source) {
    var deferred = Q.defer();
    checkCVSFsRepo(source, '.git')
        .progress(function (data){
            console.log(data);
Severity: Major
Found in lib/utils/getRepoType.js and 1 other location - About 3 hrs to fix
lib/utils/getRepoType.js on lines 82..95

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

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

function checkSvnFsRepo(source) {
    var deferred = Q.defer();
    checkCVSFsRepo(source, '.svn')
        .progress(function (data) {
            console.log(data);
Severity: Major
Found in lib/utils/getRepoType.js and 1 other location - About 3 hrs to fix
lib/utils/getRepoType.js on lines 68..81

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

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

GitHub.prototype._createTempDir = function (url){
    var deferred = Q.defer();
    temp.mkdir('storage', function(err, dirPath) {
        if(err){
            return deferred.reject(err);
Severity: Major
Found in lib/resolvers/classes/GitHub.js and 1 other location - About 3 hrs to fix
lib/resolvers/classes/Url.js on lines 22..34

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

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

Url.prototype._createTempDir = function (url) {
    var deferred = Q.defer();
    temp.mkdir('storage', function (err, dirPath) {
        if (err) {
            return deferred.reject(err);
Severity: Major
Found in lib/resolvers/classes/Url.js and 1 other location - About 3 hrs to fix
lib/resolvers/classes/GitHub.js on lines 73..85

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

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

function executeCmd(command, args, options) {
    var _proc;
    var stderr = '';
    var stdout = '';
    var deferred = Q.defer();
Severity: Major
Found in lib/utils/cmd.js - About 2 hrs to fix

    Function getRepoType has 72 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function getRepoType(source, decEndpoint){
        var deferred = Q.defer();
        checkGitRepo(source)
            .progress(function (data) {
                console.log(data);
    Severity: Major
    Found in lib/utils/getRepoType.js - About 2 hrs to fix

      Function extract has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function extract(src, dst, opts) {
          var extractor;
          var promise;
      
          opts = opts || {};
      Severity: Minor
      Found in lib/utils/extract.js - About 1 hr to fix

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

                            checkUrlRepo(source)
                                .progress(function (data) {
                                    console.log(data);
                                })
                                .then(function (){
        Severity: Major
        Found in lib/utils/getRepoType.js and 4 other locations - About 1 hr to fix
        lib/utils/getRepoType.js on lines 123..132
        lib/utils/getRepoType.js on lines 135..186
        lib/utils/getRepoType.js on lines 156..180
        lib/utils/getRepoType.js on lines 164..179

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

        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

        function checkUrlRepo(source) {
            var deferred = Q.defer();
            if (/^https?:\/\//i.exec(source)) {
                deferred.resolve(true);
            }else{
        Severity: Major
        Found in lib/utils/getRepoType.js and 1 other location - About 1 hr to fix
        lib/utils/getRepoType.js on lines 25..33

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

        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

        function Git(decEndpoint){
            if(decEndpoint){
                Base.call(this, decEndpoint);
                this.target = path.resolve(process.cwd(), this.target);
                if(!hasGit){
        Severity: Major
        Found in lib/resolvers/classes/Git.js and 1 other location - About 1 hr to fix
        lib/resolvers/classes/Svn.js on lines 16..24

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

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

                    checkGitHubRepo(source)
                        .progress(function (data) {
                            console.log(data);
                        })
                        .then(function (){
        Severity: Major
        Found in lib/utils/getRepoType.js and 4 other locations - About 1 hr to fix
        lib/utils/getRepoType.js on lines 135..186
        lib/utils/getRepoType.js on lines 143..185
        lib/utils/getRepoType.js on lines 156..180
        lib/utils/getRepoType.js on lines 164..179

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

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

                                                    checkSvnFsRepo(source)
                                                        .progress(function (data) {
                                                            console.log(data);
                                                        })
                                                        .then(function (){
        Severity: Major
        Found in lib/utils/getRepoType.js and 4 other locations - About 1 hr to fix
        lib/utils/getRepoType.js on lines 123..132
        lib/utils/getRepoType.js on lines 135..186
        lib/utils/getRepoType.js on lines 143..185
        lib/utils/getRepoType.js on lines 156..180

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

        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

        var Svn = function (decEndpoint){
            if(decEndpoint){
                Base.call(this, decEndpoint);
                this.target = path.resolve(process.cwd(), this.target);
                if(!hasSvn){
        Severity: Major
        Found in lib/resolvers/classes/Svn.js and 1 other location - About 1 hr to fix
        lib/resolvers/classes/Git.js on lines 15..23

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

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

                    checkSvnRepo(source)
                        .progress(function (data) {
                            console.log(data);
                        })
                        .then(function (){
        Severity: Major
        Found in lib/utils/getRepoType.js and 4 other locations - About 1 hr to fix
        lib/utils/getRepoType.js on lines 123..132
        lib/utils/getRepoType.js on lines 143..185
        lib/utils/getRepoType.js on lines 156..180
        lib/utils/getRepoType.js on lines 164..179

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

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

                                            checkGitFsRepo(source)
                                                .progress(function (data) {
                                                    console.log(data);
                                                })
                                                .then(function (){
        Severity: Major
        Found in lib/utils/getRepoType.js and 4 other locations - About 1 hr to fix
        lib/utils/getRepoType.js on lines 123..132
        lib/utils/getRepoType.js on lines 135..186
        lib/utils/getRepoType.js on lines 143..185
        lib/utils/getRepoType.js on lines 164..179

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

        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

        function checkSvnRepo(source) {
            var deferred = Q.defer();
            if (/^svn(\+(ssh|https?|file))?:\/\//i.test(source)) {
                deferred.resolve(true);
            }else{
        Severity: Major
        Found in lib/utils/getRepoType.js and 1 other location - About 1 hr to fix
        lib/utils/getRepoType.js on lines 34..42

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

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

        var executeCommands = function (instance, type){
            var deferred = Q.defer();
            var commands = instance[type + 'Commands'] || [];
            var cwd;
        
        
        Severity: Minor
        Found in lib/resolvers/classes/Base.js - About 1 hr to fix

          Function createLink has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function createLink(src, dst, type) {
              var dstDir = path.dirname(dst);
              // Create directory
              return Q.nfcall(mkdirp, dstDir)
                  // Check if source exists
          Severity: Minor
          Found in lib/utils/createLink.js - About 1 hr to fix

            Function _checkout has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            GitHub.prototype._checkout = function (){
                var deferred = Q.defer();
                var self = this;
                var tarballUrl = 'https://github.com/' + this.org + '/' + this.repo + '/archive/{{tag}}.tar.gz';
            
            
            Severity: Minor
            Found in lib/resolvers/classes/GitHub.js - About 1 hr to fix

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

                  fs.createReadStream(archive)
                      .on('error', deferred.reject)
                      .pipe(zlib.createGunzip())
                      .on('error', deferred.reject)
                      .pipe(fs.createWriteStream(dst))
              Severity: Major
              Found in lib/utils/extract.js and 1 other location - About 1 hr to fix
              lib/utils/extract.js on lines 68..76

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

              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

              Severity
              Category
              Status
              Source
              Language