Showing 123 of 172 total issues
Function Timeline
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
SocialStream.Timeline = (function(SS, $, undefined){
var callback = new SS.Callback();
var initModalCarousel = function() {
var elements = $('.timeline [data-modal-carousel-id="false"]');
Function tiesGraph
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.tiesGraph = function( data ) {
//TODO: better handling of width and height
var w = 860,
h = 500,
fill = d3.scale.category20();
Method save_buddy
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def save_buddy
unless SocialStream::Presence.enable
return
end
- 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 create
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def create
super do |format|
format.json { render :json => resource.to_json(helper: self), status: :created }
format.js
format.all {
- 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 Wall
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
SocialStream.Documents.Wall = (function(SS, $, undefined) {
var initWall = function() {
$('<label/>', {
"for": 'new_document_title',
style: 'display: none;',
Method notification_subject
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def notification_subject
sender_name= sender.name.truncate(30, :separator => ' ')
receiver_name= receiver.name.truncate(30, :separator => ' ')
case verb
when 'like'
Function storeConversations
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
var storeConversations = function() {
var chatboxes = PRESENCE.WINDOW.getAllChatBoxes();
var pvisibleChatBoxes = PRESENCE.WINDOW.getVisibleChatBoxes();
var storedSlugs = [];
var storedGroupSlugs = [];
Function initWall
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
var initWall = function() {
$('<label/>', {
"for": 'new_document_title',
style: 'display: none;',
text: I18n.t('activerecord.attributes.document.title')
Method executeRemoteCommands
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def executeRemoteCommands(commands)
if commands.empty?
return "No command received";
end
- 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 createChatBox
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
var createChatBox = function(guest_slug,isGroup){
var guest_name = PRESENCE.XMPPClient.getNameFromSlug(guest_slug)
if(isGroup){
Function Wall
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
SocialStream.Wall = (function(SS, $, undefined){
var callback = new SS.Callback();
var initInputAutosize = function() {
Function Event
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
SocialStream.Event = (function(SS, $, undefined) {
var callback = new SS.Callback();
var color = function(){
return SS.Events.current.eventColor;
- 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 mailboxer_email
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def mailboxer_email(object)
#If actor has disabled the emails, return nil.
return nil if !notify_by_email
#If actor has enabled the emails and has email
return "#{name} <#{email}>" if email.present?
- 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 urlDetect
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
var urlDetect = function() {
this.currentValue = $("#post_text").val();
if (this.lastValue === null) {
this.lastValue = "";
Function Explore
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
SocialStream.Explore = (function(SS, $, undefined){
var callback = new SS.Callback();
var headerPushState = function() {
$('#explore-header div').on('shown', function(e) {
Function Pagination
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
SocialStream.Pagination = (function(SS, $, undefined){
var show = function(callback) {
var nav = $('nav.more');
Function Tag
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
SocialStream.Tag = (function(SS, $, undefined) {
// Select2
var select2 = function(selector) {
$(selector).select2({
multiple: true,
Method update_all
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update_all
success = false
#If no section selected, skips and gives error
if params[:settings_section].present?
Function SearchHeader
has a Cognitive Complexity of 12 (exceeds 5 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
- 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 prototype
has 35 lines of code (exceeds 25 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();