goappes/hoodie-plugin-socialmedia

View on GitHub

Showing 9 of 36 total issues

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

module.exports = function (hoodie) {
  var SocialMedia = this;

  var _verifyAttrs = function (task, attr, cb) {
    log('_verifyAttrs', task);
Severity: Major
Found in lib/socialmedia.js - About 1 day to fix

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

      module.exports = function (grunt) {
      
        // Project configuration.
        grunt.initConfig({
      
      
      Severity: Major
      Found in Gruntfile.js - About 1 day to fix

        Function exports has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
        Open

        module.exports = function (hoodie) {
          var SocialMedia = this;
        
          var _verifyAttrs = function (task, attr, cb) {
            log('_verifyAttrs', task);
        Severity: Minor
        Found in lib/socialmedia.js - About 3 hrs 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

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

        /**
         * Dependencies
         */
        
        var async = require('async');
        Severity: Minor
        Found in lib/socialmedia.js - About 2 hrs 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
                  Severity
                  Category
                  Status
                  Source
                  Language