Showing 57 of 114 total issues
Function cbpAnimatedHeader
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var cbpAnimatedHeader = (function() {
var docElem = document.documentElement,
header = document.querySelector( '.navbar-default' ),
didScroll = false,
Function next
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function next() {
$active
.removeClass('active')
.find('> .dropdown-menu > .active')
.removeClass('active')
Function hide
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Collapse.prototype.hide = function () {
if (this.transitioning || !this.$element.hasClass('in')) return
var startEvent = $.Event('hide.bs.collapse')
this.$element.trigger(startEvent)
Function refresh
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ScrollSpy.prototype.refresh = function () {
var that = this
var offsetMethod = 'offset'
var offsetBase = 0
Method set
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def set(client, team, data, user, k, v)
Method set_api_token
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def set_api_token(client, team, data, user)
if !team.api?
set_api(client, team, data, user)
elsif user.team_admin? && !team.api_token
team.update_attributes!(api_token: SecureRandom.hex)
- 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
Consider simplifying this complex logical expression. Open
Open
if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 2)) {
throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3')
}
Method set_opt_in
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def set_opt_in(client, team, data, user, v = nil)
Method set_custom_profile_team_field
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def set_custom_profile_team_field(client, team, data, user, v = nil)
Method set_weeks
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def set_weeks(client, team, data, user, v = nil)
Method set_sync
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def set_sync(client, team, data, user, v = nil)
Method rotate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def rotate(client, team, data, user, k)
Method set_recency
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def set_recency(client, team, data, user, v = nil)
Method set_size
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def set_size(client, team, data, user, v = nil)
Method unset
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def unset(client, team, data, user, k)
Method set_day
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def set_day(client, team, data, user, v = nil)
Method set_message
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def set_message(client, team, data, user, v = nil)
Method set_api
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def set_api(client, team, data, user, v = nil)
Method set_time
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def set_time(client, team, data, user, v = nil)
Method set_followup_day
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def set_followup_day(client, team, data, user, v = nil)