Showing 419 of 859 total issues
Method sanitize_review
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def sanitize_review(html)
allow_youtube_transformer = lambda do |env|
node = env[:node]
node_name = env[:node_name]
- 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 canonical_title
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def canonical_title(preference = '')
if preference.class == User
preference = preference.title_language_preference
end
- 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 from_library_entry
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.from_library_entry(l)
return unless l.valid?
if l.persisted?
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
def update
authenticate_user!
group = Group.find(params[:id])
group_hash = params.require(:group).permit(:bio, :about, :cover_image_url, :avatar_url).to_h
- 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 s
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
s: function(val, ctx, partials, inverted, start, end, tags) {
Function ls
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
ls: function(val, ctx, partials, inverted, start, end, tags) {
Function performAction
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
Avoid deeply nested control flow statements. Open
if (v) {
partial.push(quote(k) + (gap ? ': ' : ':') + v);
}
Avoid deeply nested control flow statements. Open
if (/wn|er|in/.test(type)) {
// mousedown|mouseover|touchbegin
parent[_add](toggle);
Avoid deeply nested control flow statements. Open
if (label.length && labelHover && toggle == hoverClass) {
// mouseout|touchend
label[/ut|nd/.test(type) ? _remove : _add](labelHoverClass);
};
Function updateScrollParent
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
FastClick.prototype.updateScrollParent = function(targetElement) {
'use strict';
var scrollParent, parentElement;
scrollParent = targetElement.fastClickScrollParent;
- 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 deeply nested control flow statements. Open
if (v !== undefined) {
value[k] = v;
} else {
delete value[k];
}
Avoid deeply nested control flow statements. Open
if (tag) {
i++;
}
Function updateScrollParent
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
FastClick.prototype.updateScrollParent = function(targetElement) {
'use strict';
var scrollParent, parentElement;
scrollParent = targetElement.fastClickScrollParent;
- 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 deeply nested control flow statements. Open
if (tagType == '{') {
if (ctag == '}}') {
i++;
} else {
cleanTripleStache(tokens[tokens.length - 1]);
Function onMouse
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
FastClick.prototype.onMouse = function(event) {
'use strict';
// If a target element was never set (because a touch event was never fired) allow the event
if (!this.targetElement) {
- 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 deeply nested control flow statements. Open
if (v) {
partial.push(quote(k) + (gap ? ': ' : ':') + v);
}
Avoid deeply nested control flow statements. Open
if (node[_checked]) {
off(self, _checked);
} else {
on(self, _checked);
};
Avoid deeply nested control flow statements. Open
if (_mobile) {
event.stopPropagation();
} else {
return false;
};
Function initializeRatingInterface
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
this.initializeRatingInterface = function(element, type) {
var anime_slug, i, rating, star, _i;
return;
rating = parseInt(element.attr("data-rating"));
anime_slug = element.attr("data-anime-slug");
- 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"