Showing 123 of 172 total issues
File actor.rb
has 363 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Actor < ActiveRecord::Base
# Actor is a supertype of all subjects defined in SocialStream.subjects
supertype_of :subject
include SocialStream::Models::Object
Function Contact
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
SocialStream.Contact = (function($, SS, undefined) {
var callback = new SS.Callback();
var getForms = function(id) {
return $('[data-contact_id="' + id + '"]');
- 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 FullCalendar
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
SocialStream.FullCalendar = (function(SS, $, Scheduler, undefined){
var callback = new SS.Callback(),
current,
eventColor = 'gray';
Class Activity
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
class Activity < ActiveRecord::Base
# FIXME: this does not follow the Rails way
include NotificationsHelper
# This has to be declared before 'has_ancestry' to work around rails issue #670
Function wire
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
wire: function() {
var self = this;
this.input.click(function() {
self.lastAbbreviation = null;
File jquery.ui.chatbox.sstreampresence.js
has 307 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* Copyright 2010, Wen Pu (dexterpu at gmail dot com)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
Function Wall
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
SocialStream.Linkser.Wall = (function(SS, $) {
var callback = new SS.Callback();
var regexp = /^(http|ftp|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&;:\/~+#-]*[\w@?^=%&;\/~+#-])?$/
var urlDetect = function() {
- 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 initialize
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(subject)
#Download alias action
alias_action :download, :to => :read
alias_action :original, :to => :read
File activity.rb
has 285 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Activity < ActiveRecord::Base
# FIXME: this does not follow the Rails way
include NotificationsHelper
# This has to be declared before 'has_ancestry' to work around rails issue #670
Function SearchHeader
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
SocialStream.SearchHeader = (function(SS, $, undefined){
var callback = new SS.Callback();
var nav, mat, timestamp_query, new_query;
var MIN_TIME_BETWEEN_QUERIES = 1200; // ms
Function Wall
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
SocialStream.Linkser.Wall = (function(SS, $) {
var callback = new SS.Callback();
var regexp = /^(http|ftp|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&;:\/~+#-]*[\w@?^=%&;\/~+#-])?$/
var urlDetect = function() {
Function initialize
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initialize() {
var map = Gmaps.map.serviceObject;
var input = document.getElementById('place_title');
var autocomplete = new google.maps.places.Autocomplete(input);
Function Object
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
SocialStream.Object = (function(SS, $, undefined){
var callback = new SS.Callback(),
pIcon = '<i class="icon_tool16-private"></i>';
Class ActivityObject
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class ActivityObject < ActiveRecord::Base
attr_reader :_activity_parent_id
# ActivityObject is a supertype of SocialStream.objects
supertype_of :object
Method generate_token
has a Cognitive Complexity of 18 (exceeds 5 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]
- 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 Comment
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
SocialStream.Comment = (function(SS, $, undefined){
var callback = new SS.Callback();
var elAlwaysHidden = [
"input[type=submit]"
- 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 parseWord
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parseWord(word){
//Look for empty or simple words
if ((word.trim()=="")||(word.match(simple_word_pattern)!=null)){
return word
Method updateSettings
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def updateSettings
success = false
#If no section selected, skips and gives error
- 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 index
has a Cognitive Complexity of 17 (exceeds 5 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"
- 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
File contact.js
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
// require jquery.ba-url
//
//= require social_stream/callback
SocialStream.Contact = (function($, SS, undefined) {