Showing 15 of 15 total issues
Function MentionsInput
has 295 lines of code (exceeds 25 allowed). Consider refactoring. Open
var MentionsInput = function (settings) {
var domInput,
elmInputBox,
elmInputWrapper,
File jquery-mentions.js
has 369 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* Mentions Input
* Version 1.0.2
* Written by: Kenneth Auchenberg (Podio)
*
Method find_for_oauth
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def self.find_for_oauth(auth, signed_in_resource = nil)
# Get the identity and user if they exist
identity = Identity.find_for_oauth(auth)
- 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 populateDropdown
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function populateDropdown(query, results) {
elmAutocompleteList.show(); //Shows the autocomplete list
if(!settings.allowRepeat) {
// Filter items that has already been mentioned
Function onInputBoxKeyDown
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function onInputBoxKeyDown(e) {
// This also matches HOME/END on OSX which is CMD+LEFT, CMD+RIGHT
if (e.keyCode === KEY.LEFT || e.keyCode === KEY.RIGHT || e.keyCode === KEY.HOME || e.keyCode === KEY.END) {
// Defer execution to ensure carat pos has changed after HOME/END keys then call the resetBuffer function
Method finish_signup
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def finish_signup
#authorize! :update, @user
@user.email = nil if !@user.email_verified?
if request.patch? && params[:user]
if @user.update(user_params)
- 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 setup
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
setup: function(data, namespaces) {
var timer,
// Get a reference to the element
elem = this,
// Store the current state of the element
Method avatar_for
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def avatar_for(user, size)
return unless user
avatar_url = if user.avatar_url.nil?
avatar_path = Digest::MD5.hexdigest(user.email.downcase)
if size == 'small'
- 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 update
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def update
# authorize! :update, @user
respond_to do |format|
if @user.update(user_params)
sign_in(@user == current_user ? @user : current_user, :bypass => true)
- 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
Avoid too many return
statements within this function. Open
return true;
Avoid too many return
statements within this function. Open
return false;
Method cache_content
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def cache_content
context = {
asset_root: 'https://a248.e.akamai.net/assets.github.com/images/icons/',
base_url: '/users/'
}
- 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 upvote
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def upvote
if @game.scheduled_at?
@game.upvote_by(current_user)
else
flash[:error] = "Sorry. You can't vote on unpublished games"
- 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 mention_emails
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def mention_emails
HTML::Pipeline::MentionFilter.mentioned_logins_in(content) do |mention|
pre = mention[0] == "@" ? "" : mention.slice!(0)
mention_user = User.find_for_mention(mention)
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
def index
@current_week = params[:week].present? ? Date.parse(params[:week]) : Date.today.beginning_of_week
@last_week = @current_week - 7.days
@next_week = @current_week + 7.days
- 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"