Showing 20 of 51 total issues
Function applyTextcomplete
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
function applyTextcomplete($btnGroup) {
var textcompletesPath = $btnGroup.attr('data-textcomplete-path');
var $input = $('input', $btnGroup);
var $dropdownToggle = $('.dropdown-toggle', $btnGroup);
var $dropdown = $('.dropdown-menu', $btnGroup);
Class Account
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class Account < ActiveRecord::Base
include ActiveRecord::UUID
PRO_PLAN_ID = 'pro-30'
Method create
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def create
if existing_user = User.find_by(email: params[:user][:email])
@user = existing_user
if current_user.email == params[:user][:email]
- 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 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create
if existing_user = User.find_by(email: params[:user][:email])
@user = existing_user
if current_user.email == params[:user][:email]
Function renderHeader
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderHeader: function() {
var title = null;
var preview = null;
var timestamp = null;
Method create
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create
content_type = 'application/json'
if params[:callback].present?
request.format = 'json'
Method create
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create
@account = Account.new(account_params)
@user = User.new(user_params)
@person = Person.where(email: @user.email).first_or_initialize
Function createMessage
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
createMessage: function() {
if(this.props.demo) {
$.get('/user.json', function(response) {
var message = {
id: 'message-' + (new Date()).getTime(),
Method create
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create
require_mailgun_params!
ActiveRecord::Base.transaction do
# Finds Account
Function render
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function() {
var creatorName = null;
var creatorEmail = null;
var participants = null;
Function toggleHandler
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
toggleHandler: function(toggled) {
return function(event) {
event.stopPropagation();
event.preventDefault();
- 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 archiveHandler
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
archiveHandler: function(conversation) {
return function(event) {
if(event) {
event.stopPropagation();
event.preventDefault();
Function removeTagHandler
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
removeTagHandler: function(removeFrom) {
return function(tag) {
return function(event) {
event.stopPropagation();
event.preventDefault();
Method links
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def links
_fast_links
rescue NameError
method = "def _fast_links\n"
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
def create
message = MessageFactory.build(message_params)
if message.save
message.conversation.archive! if archive_conversation?
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
def create
@account = Account.new(account_params)
@user = User.new(user_params)
@person = Person.where(email: @user.email).first_or_initialize
- 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 render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
render: function() {
if(this.state.conversations.length) {
var conversations = this.state.conversations.map(this.renderConversation);
return (
- 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 conversationsPath
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
conversationsPath: function() {
var path = [];
path.push('/accounts/');
path.push(this.props.accountSlug);
path.push('/conversations.json');
- 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 addStreamItemHandler
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
addStreamItemHandler: function(addedTo) {
return function(streamItem) {
var conversations = this.state.conversations.map(function(conversation) {
if(conversation === addedTo) {
switch(streamItem.type) {
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
def create
require_mailgun_params!
ActiveRecord::Base.transaction do
# Finds Account
- 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"