goappes/hoodie-plugin-socialmedia

View on GitHub
hoodie.socialmedia.js

Summary

Maintainability
F
1 wk
Test Coverage

File hoodie.socialmedia.js has 601 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Hoodie plugin socialmedia
 * Lightweight and easy socialmedia
 */

Severity: Major
Found in hoodie.socialmedia.js - About 1 day to fix

    Function post has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        post: function (postObject, userId) {
          var defer = window.jQuery.Deferred();
          defer.notify('post', arguments, false);
          userId = userId || hoodie.id();
          postObject.userId = userId;
    Severity: Minor
    Found in hoodie.socialmedia.js - About 1 hr to fix

      Function _addProfileOnCountType has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        var _addProfileOnCountType = function (collection, countType) {
          var defer = window.jQuery.Deferred();
          defer.notify('addProfile', arguments, false);
      
          var ids = collection.map(function (v) {
      Severity: Minor
      Found in hoodie.socialmedia.js - About 1 hr to fix

        Function _addProfileOnComments has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          var _addProfileOnComments = function (collection) {
            var defer = window.jQuery.Deferred();
            defer.notify('addProfile', arguments, false);
        
            var ids = collection.map(function (v) {
        Severity: Minor
        Found in hoodie.socialmedia.js - About 1 hr to fix

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

              deletePost: function (postObject, userId) {
                var defer = window.jQuery.Deferred();
                defer.notify('deletePost', arguments, false);
                userId = userId || hoodie.id();
                var task = {
          Severity: Minor
          Found in hoodie.socialmedia.js - About 1 hr to fix

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

              var _handleAttr = function (task, attr) {
                var defer = window.jQuery.Deferred();
                var ids = task.pubsub.subscribers.map(function (v) {
                  return v.userId;
                });
            Severity: Major
            Found in hoodie.socialmedia.js and 1 other location - About 7 hrs to fix
            hoodie.socialmedia.js on lines 29..44

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

            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 _handleFollowing = function (task) {
                var defer = window.jQuery.Deferred();
                var ids = task.pubsub.subscriptions.map(function (v) {
                  return v.userId;
                });
            Severity: Major
            Found in hoodie.socialmedia.js and 1 other location - About 7 hrs to fix
            hoodie.socialmedia.js on lines 46..61

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

            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

                updateComment: function (postObject, commentObject) {
                  var defer = window.jQuery.Deferred();
                  defer.notify('updateComment', arguments, false);
                  var task = {
                    socialmedia: {
            Severity: Major
            Found in hoodie.socialmedia.js and 2 other locations - About 4 hrs to fix
            hoodie.socialmedia.js on lines 449..463
            hoodie.socialmedia.js on lines 493..507

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

            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

                uncount: function (postObject, countType) {
                  var defer = window.jQuery.Deferred();
                  defer.notify('uncount', arguments, false);
                  var task = {
                    socialmedia: {
            Severity: Major
            Found in hoodie.socialmedia.js and 2 other locations - About 4 hrs to fix
            hoodie.socialmedia.js on lines 434..448
            hoodie.socialmedia.js on lines 449..463

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

            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

                deleteComment: function (postObject, commentObject) {
                  var defer = window.jQuery.Deferred();
                  defer.notify('', arguments, false);
                  var task = {
                    socialmedia: {
            Severity: Major
            Found in hoodie.socialmedia.js and 2 other locations - About 4 hrs to fix
            hoodie.socialmedia.js on lines 434..448
            hoodie.socialmedia.js on lines 493..507

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

            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 _subscriptions = function (userId) {
                var defer = window.jQuery.Deferred();
                defer.notify('_subscriptions', arguments, false);
                hoodie.pubsub.subscriptionsByType(hoodie.socialmedia.pubsubtypes, userId)
                  .then(defer.resolve)
            Severity: Major
            Found in hoodie.socialmedia.js and 1 other location - About 3 hrs to fix
            hoodie.socialmedia.js on lines 11..18

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

            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 _subscribers = function (userId) {
                var defer = window.jQuery.Deferred();
                defer.notify('_subscribers', arguments, false);
                hoodie.pubsub.subscribersByType(hoodie.socialmedia.pubsubtypes, userId)
                  .then(defer.resolve)
            Severity: Major
            Found in hoodie.socialmedia.js and 1 other location - About 3 hrs to fix
            hoodie.socialmedia.js on lines 20..27

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

            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

                follow: function (userId) {
                  var defer = window.jQuery.Deferred();
                  defer.notify('follow', arguments, false);
                  hoodie.pubsub.subscribe(userId, hoodie.socialmedia.pubsubtypes)
                    .then(defer.resolve)
            Severity: Major
            Found in hoodie.socialmedia.js and 2 other locations - About 3 hrs to fix
            hoodie.socialmedia.js on lines 203..210
            hoodie.socialmedia.js on lines 574..583

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

            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

                unfollow: function (userId) {
                  var defer = window.jQuery.Deferred();
                  defer.notify('unfollow', arguments, false);
                  hoodie.pubsub.unsubscribe(userId, hoodie.socialmedia.pubsubtypes)
                    .then(defer.resolve)
            Severity: Major
            Found in hoodie.socialmedia.js and 2 other locations - About 3 hrs to fix
            hoodie.socialmedia.js on lines 194..201
            hoodie.socialmedia.js on lines 574..583

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

            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

                dualFollow: function (userId) {
                  var defer = window.jQuery.Deferred();
                  defer.notify('dualFollow', arguments, false);
            
                  hoodie.pubsub.bidirectional(userId, hoodie.socialmedia.pubsubtypes)
            Severity: Major
            Found in hoodie.socialmedia.js and 2 other locations - About 3 hrs to fix
            hoodie.socialmedia.js on lines 194..201
            hoodie.socialmedia.js on lines 203..210

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

            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

                getProfile: function (userId) {
                  var defer = window.jQuery.Deferred();
                  defer.notify('getProfile', arguments, false);
                  hoodie.profile.get(userId)
                    .then(defer.resolve)
            Severity: Major
            Found in hoodie.socialmedia.js and 1 other location - About 2 hrs to fix
            hoodie.socialmedia.js on lines 636..643

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

            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

                updateProfile: function (profile) {
                  var defer = window.jQuery.Deferred();
                  defer.notify('updateProfile', arguments, false);
                  hoodie.profile.set(profile)
                    .then(defer.resolve)
            Severity: Major
            Found in hoodie.socialmedia.js and 1 other location - About 2 hrs to fix
            hoodie.socialmedia.js on lines 212..219

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

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

                  if (userId === hoodie.id()) {
                    hoodie.store.findAll('post')
                      .then(hoodie.socialmedia.returnTask('feed', defer.resolve))
                      .fail(defer.reject);
                  } else {
            Severity: Major
            Found in hoodie.socialmedia.js and 3 other locations - About 1 hr to fix
            hoodie.socialmedia.js on lines 264..273
            hoodie.socialmedia.js on lines 289..298
            hoodie.socialmedia.js on lines 313..328

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

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

                      if (userId === hoodie.id()) {
                        hoodie.store.add('post', postObject)
                          .then(hoodie.socialmedia.returnTask('post', defer.resolve))
                          .fail(defer.reject);
                      } else {
            Severity: Major
            Found in hoodie.socialmedia.js and 3 other locations - About 1 hr to fix
            hoodie.socialmedia.js on lines 289..298
            hoodie.socialmedia.js on lines 313..328
            hoodie.socialmedia.js on lines 395..404

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

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

                  if (userId === hoodie.id()) {
                    hoodie.store.update('post', postObject.id, postObject)
                      .then(hoodie.socialmedia.returnTask('post', defer.resolve))
                      .fail(defer.reject);
                  } else {
            Severity: Major
            Found in hoodie.socialmedia.js and 3 other locations - About 1 hr to fix
            hoodie.socialmedia.js on lines 264..273
            hoodie.socialmedia.js on lines 313..328
            hoodie.socialmedia.js on lines 395..404

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

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

                  if (userId === hoodie.id()) {
                    if (!postObject) {
                      hoodie.store.removeAll('post')
                        .then(defer.resolve)
                        .fail(defer.reject);
            Severity: Major
            Found in hoodie.socialmedia.js and 3 other locations - About 1 hr to fix
            hoodie.socialmedia.js on lines 264..273
            hoodie.socialmedia.js on lines 289..298
            hoodie.socialmedia.js on lines 395..404

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

            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

                    hoodie.task('socialmediafeed').start(task)
                      .then(function (task) {
                        return hoodie.socialmedia.addProfileOnPosts(task.socialmedia.feed);
                      })
                      .then(hoodie.socialmedia.returnTask('feed', defer.resolve))
            Severity: Major
            Found in hoodie.socialmedia.js and 1 other location - About 1 hr to fix
            hoodie.socialmedia.js on lines 516..527

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

            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

                  hoodie.task('socialmediagetpost').start(task)
                    .then(function (task) {
                      return hoodie.socialmedia.addProfileOnPost(task.socialmedia.post);
                    })
                    .then(function (post) {
            Severity: Major
            Found in hoodie.socialmedia.js and 1 other location - About 1 hr to fix
            hoodie.socialmedia.js on lines 375..379

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

            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 uniqueArray = ids.filter(function (item, pos, self) {
                  return (self.indexOf(item) === pos && item !== undefined);
                });
            Severity: Minor
            Found in hoodie.socialmedia.js and 1 other location - About 35 mins to fix
            hoodie.socialmedia.js on lines 159..161

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

            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 uniqueArray = ids.filter(function (item, pos, self) {
                  return (self.indexOf(item) === pos && item !== undefined);
                });
            Severity: Minor
            Found in hoodie.socialmedia.js and 1 other location - About 35 mins to fix
            hoodie.socialmedia.js on lines 124..126

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

            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

            There are no issues that match your filters.

            Category
            Status