Showing 63 of 206 total issues
Function hightlight
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function hightlight(o) {
var regex;
o = _.mixin({}, defaults, o);
if (!o.node || !o.pattern) {
return;
- Create a ticketCreate a ticket
Function updateNavArrows
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateNavArrows: function(){
if (!this._allow_update)
return;
var d = new Date(this.viewDate),
- Create a ticketCreate a ticket
Function dateUpdated
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
dateUpdated: function(e){
// `this.updating` is a workaround for preventing infinite recursion
// between `changeDate` triggering and `setUTCDate` calling. Until
// there is a better mechanism.
if (this.updating)
- Create a ticketCreate a ticket
Function set
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
NProgress.set = function(n) {
var started = NProgress.isStarted();
n = clamp(n, Settings.minimum, 1);
NProgress.status = (n === 1 ? null : n);
- Create a ticketCreate a ticket
Function Input
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Input(o, www) {
var id;
o = o || {};
if (!o.input) {
$.error("input is missing");
- Create a ticketCreate a ticket
Method update_user_commit_counts_for
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def update_user_commit_counts_for(project)
contributors = get_contributor_stats(project.github_repo)
contributors.map do |contributor|
user = User.find_by_github_username(contributor.author.login)
- Read upRead up
- Create a ticketCreate a ticket
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 display_countdown
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def display_countdown(event)
time_to_next_event_instance = Time.now.to_datetime.distance_to(event.next_occurrence_time_attr.to_datetime)
minutes_left = time_to_next_event_instance[:minutes]
hours_left = time_to_next_event_instance[:hours]
days_left = time_to_next_event_instance[:days]
- Read upRead up
- Create a ticketCreate a ticket
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 AffixedNavbar
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function AffixedNavbar() {
var isAffixed, affixedNav, header, main, footer, thresholdTop,
isListening = false;
this.onScroll = function() {
- Create a ticketCreate a ticket
Function formatDate
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
formatDate: function(date, format, language){
if (!date)
return '';
if (typeof format === 'string')
format = DPGlobal.parseFormat(format);
- Create a ticketCreate a ticket
Function _fill_yearsView
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
_fill_yearsView: function(selector, cssClass, factor, year, startYear, endYear, beforeFn){
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (e.keyCode === 38 || e.keyCode === 40) {
dir = dir * 4;
}
- Create a ticketCreate a ticket
Method with
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.with(user, sponsor, time, plan, payment_source, subscription_klass = Subscription)
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
} else if (e.keyCode === 37 || e.keyCode === 39){
newViewDate = this.moveAvailableDate(focusDate, dir, 'moveDay');
} else if (!this.weekOfDateIsDisabled(focusDate)){
newViewDate = this.moveAvailableDate(focusDate, dir, 'moveWeek');
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (newViewDate)
this._trigger('changeMonth', this.viewDate);
- Create a ticketCreate a ticket
Method remove_from_schedule
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def remove_from_schedule(timedate)
# best if schedule is serialized into the events record... and an attribute.
if timedate >= Time.now && timedate == next_occurrence_time_method
_next_occurrences = next_occurrences(limit: 2)
self.start_datetime = _next_occurrences.size > 1 ? _next_occurrences[1][:time] : timedate + 1.day
- Read upRead up
- Create a ticketCreate a ticket
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 destroy
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def destroy
@authentication = current_user.authentications.find(params[:id])
if @authentication && (current_user.authentications.count == 1) && current_user.encrypted_password.blank?
flash[:alert] = 'Failed to unlink GitHub. Please use another provider for login or reset password.'
elsif @authentication&.destroy
- Read upRead up
- Create a ticketCreate a ticket
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 7 (exceeds 5 allowed). Consider refactoring. Open
def create
omniauth = request.env['omniauth.auth']
authentication = Authentication.find_by_provider_and_uid(omniauth['provider'], omniauth['uid'])
@path = request.env['omniauth.origin'] || root_path
if authentication.present?
- Read upRead up
- Create a ticketCreate a ticket
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
# "user_slug"=>"<slug>", "subscription"=>{"plan_id"=>"12"},
# "commit"=>"Adjust Level", "controller"=>"subscriptions", "action"=>"update", "id"=>"45"} permitted: false>
begin
plan = Plan.find params[:subscription][:plan_id]
- Read upRead up
- Create a ticketCreate a ticket
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 date;
- Create a ticketCreate a ticket
Method process_markdown_pages
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def process_markdown_pages(md_pages)
md_pages.each do |page|
filename = page[:path]
page_content = client.contents('agileventures/agileventures', path: filename)
markdown = Base64.decode64(page_content[:content])
- Read upRead up
- Create a ticketCreate a ticket
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"