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.*').
Method executeRemoteCommands
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def executeRemoteCommands(commands)
if commands.empty?
return "No command received";
end
Method save_buddy
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def save_buddy
unless SocialStream::Presence.enable
return
end
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]
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,
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");
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"
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;
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
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>';
- Read upRead up
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');
- Read upRead up
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)
- Read upRead up
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) {
- Read upRead up
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)
- Read upRead up
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!
- Read upRead up
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"
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
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;
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();
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)