Showing 407 of 1,024 total issues
Method high
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def high(user, entry)
roles = [:none, :member, :previewer, :editor, :publisher, :manager]
account_membership = Membership.where(user: user, entity: entry.account).first
account_role = account_membership ? account_membership.role : :none
- 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 hooks
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const hooks = function(player, hooks) {
var originalPlay = player.play;
player.updateHooks = (newHooks) => {
hooks = newHooks;
- 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 initialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
initialize() {
const storage = this.getLocalStorage();
if (storage) {
if (storage['pageflow.settings']) {
- 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 entry_global_links
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def entry_global_links(entry)
links = []
if entry.site.imprint_link_label.present? && entry.site.imprint_link_url.present?
links << link_to(raw(entry.site.imprint_link_label),
- 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 mobile_poster_image_div
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def mobile_poster_image_div(config = {})
classes = ['background', 'background_image']
position = {x: 50, y: 50}
if config['mobile_poster_image_id']
- 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 can?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def can?(action, subject)
if [:read, :new, :create].include?(action) &&
[Entry, Account, User].include?(subject)
collection_name = subject.name.demodulize.underscore.pluralize.to_sym
- 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 file_importer_credentials
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def file_importer_credentials
token = AuthenticationToken.find_auth_token(current_user, authentication_provider) if
authentication_provider.present?
unless token.nil?
token =
- 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"