ging/social_stream

View on GitHub

Showing 123 of 172 total issues

Method contact_actors has 33 lines of code (exceeds 25 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 1 hr to fix

    Method executeRemoteCommands has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

              def executeRemoteCommands(commands)
                if commands.empty?
                  return "No command received";
                end
                
    Severity: Minor
    Found in presence/lib/social_stream/presence/xmpp_server_order.rb - About 1 hr to fix

      Method save_buddy has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              def save_buddy
                
                unless SocialStream::Presence.enable
                  return
                end
      Severity: Minor
      Found in presence/lib/social_stream/presence/models/buddy_manager.rb - About 1 hr to fix

        Method generate_token has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def generate_token(opts = {})
              {:session_id=>nil, :create_time=>nil, :expire_time=>nil, :role=>nil, :connection_data=>nil}.merge!(opts)
        
              create_time = opts[:create_time].nil? ? Time.now  :  opts[:create_time]
              session_id = opts[:session_id].nil? ? '' : opts[:session_id]
        Severity: Minor
        Found in presence/lib/OpenTok/OpenTokSDK.rb - About 1 hr to fix

          Function Actor has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          SocialStream.Actor = (function(SS, $, undefined) {
            // Select2
            var select2 = function(selector) {
              $(selector).select2({
                multiple: true,
          Severity: Minor
          Found in base/app/assets/javascripts/social_stream/actor.js - About 1 hr to fix

            Function show has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              var show = function(callback) {
                var nav = $('nav.more');
            
                $('a', nav).each(function(i, btn) {
                  $(btn).attr('data-page', "2");
            Severity: Minor
            Found in base/app/assets/javascripts/social_stream/pagination.js - About 1 hr to fix

              Method index has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def index
                  @search_result =
                    if params[:q].blank? || params[:q].strip.size < SocialStream::Search::MIN_QUERY
                      Kaminari.paginate_array([])
                    elsif params[:mode] == "quick"
              Severity: Minor
              Found in base/app/controllers/search_controller.rb - About 1 hr to fix

                Function searchQuery has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  var searchQuery = function() {  
                    var dif =  new Date().getTime() - timestamp_query;
                    if(dif < MIN_TIME_BETWEEN_QUERIES){
                      new_query = true;
                      return;
                Severity: Minor
                Found in base/app/assets/javascripts/social_stream/search_header.js - About 1 hr to fix

                  Method create_ability_file has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def create_ability_file
                      ability_code = [
                        "# Generator social_stream:install has modified this file. Please,",   #0
                        "# check everything is working ok, specially if the former `Ability`", #1
                        "# class inherited from another class or included another module",     #2
                  Severity: Minor
                  Found in base/lib/generators/social_stream/base/install_generator.rb - About 1 hr to fix

                    Function Object has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                    SocialStream.Object = (function(SS, $, undefined){
                      var callback = new SS.Callback(),
                          pIcon = '<i class="icon_tool16-private"></i>';
                    
                    
                    
                    Severity: Minor
                    Found in base/app/assets/javascripts/social_stream/object.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 RelationCustom has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                    SocialStream.RelationCustom = (function(SS, $, undefined){
                      var callback = new SS.Callback();
                    
                      var getListEl = function() {
                        return $('.relation_list');
                    Severity: Minor
                    Found in base/app/assets/javascripts/social_stream/relation_customs.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

                    Method do_request has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def do_request(api_url, params, token=nil)
                    
                          url = URI.parse(@api_url + api_url)
                          if not params.empty?
                            req = Net::HTTP::Post.new(url.path)
                    Severity: Minor
                    Found in presence/lib/OpenTok/OpenTokSDK.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 Explore has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                    SocialStream.Explore = (function(SS, $, undefined){
                      var callback = new SS.Callback();
                    
                      var headerPushState = function() {
                        $('#explore-header div').on('shown', function(e) {
                    Severity: Minor
                    Found in base/app/assets/javascripts/social_stream/explore.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

                    Method method_missing has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                          def method_missing(method, *args, &block)
                            super
                          rescue NameError => subtype_error
                            raise subtype_error unless _delegate_to_supertype?(:method)
                    
                    
                    Severity: Minor
                    Found in base/lib/social_stream/models/subtype.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

                    Method authenticator has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                          def authenticator
                            Rack::OAuth2::Server::Token.new do |req, res|
                              client = Site::Client.find(req.client_id) || req.invalid_client!
                              client.secret == req.client_secret || req.invalid_client!
                    
                    
                    Severity: Minor
                    Found in oauth2_server/lib/social_stream/oauth2_server/token_endpoint.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

                    Method change has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def change
                    
                        create_table "geotags", :force => true do |t|
                          t.integer  "activity_object_id"
                          t.integer  "address_id"
                    Severity: Minor
                    Found in places/db/migrate/20130114184300_create_social_stream_places.rb - About 1 hr to fix

                      Method generateRSAKeys has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                def generateRSAKeys(keysPath)
                                  
                                  unless File.directory?(keysPath)
                                    return "Keys path not exists"
                                  end
                      Severity: Minor
                      Found in presence/lib/social_stream/presence/xmpp_server_order.rb - About 1 hr to fix

                        Function Event has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        SocialStream.Event = (function(SS, $, undefined) {
                          var callback = new SS.Callback();
                        
                          var color = function(){
                            return SS.Events.current.eventColor;
                        Severity: Minor
                        Found in events/app/assets/javascripts/social_stream/event.js - About 1 hr to fix

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

                          SocialStream.Repository = (function(SS, $, undefined){
                            var callback = new SS.Callback();
                          
                            var initFilter = function() {
                              $('.repository .loading').hide();
                          Severity: Minor
                          Found in base/app/assets/javascripts/social_stream/repository.js - About 1 hr to fix

                            Method do_request has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                def do_request(api_url, params, token=nil)
                            
                                  url = URI.parse(@api_url + api_url)
                                  if not params.empty?
                                    req = Net::HTTP::Post.new(url.path)
                            Severity: Minor
                            Found in presence/lib/OpenTok/OpenTokSDK.rb - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language