Showing 7 of 13 total issues
File application.js
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
//= require jquery-min.js
//= require bootstrap-min.js
//= require bootstrap.file-input.js
//= require mousetrap-min.js
//= require jquery-visible-min.js
Function storyClicked
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
storyClicked: function(e) {
if (e.metaKey || e.ctrlKey || e.which == 2) {
var backgroundTab = window.open(this.model.get("permalink"));
if (backgroundTab) backgroundTab.blur();
window.focus();
- 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 call
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.call(raw_feed, feed_id, latest_entry_id = nil)
stories = []
raw_feed.entries.each do |story|
break if latest_entry_id && story.id == latest_entry_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 expand_absolute_urls
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def expand_absolute_urls(content, base_url)
doc = Nokogiri::HTML.fragment(content)
[["a", "href"], ["img", "src"], ["video", "src"]].each do |tag, attr|
doc.css("#{tag}[#{attr}]").each do |node|
- 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 boolean_accessor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.boolean_accessor(attribute, key, default: false)
store_accessor(attribute, key)
define_method(key) do
value = super()
- 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_api_key
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update_api_key
return unless password_digest_changed? || username_changed?
if password_challenge.blank? && password.blank?
message = "Cannot change username without providing a password"
- 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
authorization.skip
@feed_url = params[:feed_url]
feed = Feed::Create.call(@feed_url, user: current_user)
- 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"