ging/social_stream

View on GitHub

Showing 123 of 172 total issues

Function initFullCalendar has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  var initFullCalendar = function() {
    var calendar = getCalendarEl();

    var options = {
      header: {
Severity: Minor
Found in events/app/assets/javascripts/social_stream/fullcalendar.js - About 1 hr to fix

    Function _setOption has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        _setOption: function(option, value) {
            if(value != null){
              switch(option) {
                    case "hidden":
                        if(value) {

      Method destroy has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

        def destroy
      
          @conversation.move_to_trash(@actor)
      
          respond_to do |format|
      Severity: Minor
      Found in base/app/controllers/conversations_controller.rb - 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 STORE has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      PRESENCE.STORE = (function(P,$,undefined){
      
        var init = function(){ }
          
          var storePassword = function() {
      Severity: Minor
      Found in presence/app/assets/javascripts/presence_store.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 prototype has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      SocialStream.Callback.prototype = (function(SS, $, undefined) {
        var register = function() {
          var callback = this,
              funcs    = Array.prototype.slice.call(arguments),
              name     = funcs.shift();
      Severity: Minor
      Found in base/app/assets/javascripts/social_stream/callback.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 buildYoutubeVideoLink has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function buildYoutubeVideoLink(url){
            //Get youtube video id
            var youtube_video_id=url.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0];
            var youtube_api_url = "http://gdata.youtube.com/feeds/api/videos/" + youtube_video_id
          
      Severity: Minor
      Found in presence/app/assets/javascripts/presence_parser.js - About 1 hr to fix

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

          var loadPermissionList = function(el) {
            var radioInput = $(el);
            var relVal = radioInput.val();
        
            $('#permissions').find('.postit').hide();
        Severity: Minor
        Found in base/app/assets/javascripts/social_stream/relation_customs.js - About 1 hr to fix

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

          SocialStream.SiteClient = (function(SS, $, undefined) {
            var callback = new SS.Callback();
          
            var initNewModal = function() {
              $('.new_site_client-modal-link').attr('href', '#new_site_client-modal');
          Severity: Minor
          Found in oauth2_server/app/assets/javascripts/social_stream/site_client.js - About 1 hr to fix

            Method authorization has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                      def authorization(params)
                        case SocialStream::Presence.secure_rest_api
                        when true
                          #Authorization using asymmetric RSA keys
                          begin
            Severity: Minor
            Found in presence/lib/social_stream/presence/xmpp_server_order.rb - About 1 hr to fix

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

              SocialStream.Profile = (function(SS, $, undefined){
                var callback = new SS.Callback();
              
                var initEditButtons = function(options) {
                  $("#profile-info .update").filter(function(i, el) {
              Severity: Minor
              Found in base/app/assets/javascripts/social_stream/profile.js - About 1 hr to fix

                Method models has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                      def models(search_type, key = nil)
                        case search_type
                        when :quick
                          quick_search_models
                        when :extended
                Severity: Minor
                Found in base/lib/social_stream/search.rb - About 55 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Method fill has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                  def fill linkser_object
                    self.title = linkser_object.title if linkser_object.title
                    self.description = linkser_object.description if linkser_object.description
                    self.url = linkser_object.last_url
                    r = linkser_object.resource
                Severity: Minor
                Found in linkser/app/models/link.rb - About 55 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function Action has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                SocialStream.Events.Action = (function(SS, $, undefined){
                  var animateCalendar = function(action) {
                    if (action.activity_object.type != "Event") {
                      return;
                    }
                Severity: Minor
                Found in events/app/assets/javascripts/social_stream/events.action.js - About 55 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Method contact_actors has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                  def contact_actors(options = {})
                    subject_types   = Array(options[:type] || self.class.subtypes)
                    subject_classes = subject_types.map{ |s| s.to_s.classify }
                    
                    as = Actor.select('actors.*').
                Severity: Minor
                Found in base/app/models/actor.rb - About 55 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Method authorize_endpoint has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                  def authorize_endpoint(allow_approval = false)
                    Rack::OAuth2::Server::Authorize.new do |req, res|
                      @client = Site::Client.find(req.client_id) || req.bad_request!
                
                      res.redirect_uri = @redirect_uri = req.verify_redirect_uri!(@client.callback_url)
                Severity: Minor
                Found in oauth2_server/app/controllers/authorizations_controller.rb - About 55 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Method initialize has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                      def initialize(subject)
                        
                        #Download alias action
                        alias_action :download, :to => :read
                        alias_action :original, :to => :read
                Severity: Minor
                Found in base/lib/social_stream/base/ability.rb - About 55 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Method find_profile_subject has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                      def find_profile_subject
                        SocialStream.profile_subject_keys.each do |type|
                          id = params["#{ type }_id"]
                
                          next if id.blank?
                Severity: Minor
                Found in base/lib/social_stream/controllers/helpers.rb - About 45 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Method document_details_tab_class has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                  def document_details_tab_class(document, tab)
                    editing = document && document.errors.present?
                
                    case tab
                    when :edit
                Severity: Minor
                Found in documents/app/helpers/documents_helper.rb - About 45 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Method process_dirty_object has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                  def process_dirty_object(context,new_list)
                    value = new_list.is_a?(Array) ? new_list.join(', ') : new_list
                    attrib = "#{context.to_s.singularize}_list"
                
                    if changed_attributes.include?(attrib)
                Severity: Minor
                Found in base/lib/acts_as_taggable_on/social_stream.rb - About 45 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Method setRosterForBidirectionalTie has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                          def setRosterForBidirectionalTie(userASid,userBSid,userANick,userBNick,groupForA,groupForB)
                Severity: Minor
                Found in presence/lib/social_stream/presence/xmpp_server_order.rb - About 45 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language