Showing 92 of 413 total issues
Avoid too many return
statements within this method. Open
return "bril" if name =~ /^bril/i
Avoid too many return
statements within this method. Open
return "kwz" if name =~ /^kwz/i
Avoid too many return
statements within this method. Open
return "pilot" if name =~ /iroshizuku/i
Avoid too many return
statements within this method. Open
return "sbre" if name =~ /^sbre\s*(brown)?$/i
Avoid too many return
statements within this method. Open
return "thorntons" if name =~ /^thornton/i
Function PenAndInkSuggestionWidgetContent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const PenAndInkSuggestionWidgetContent = () => {
const { data } = useContext(WidgetDataContext);
const { by_kind } = data.attributes;
const [suggestion, setSuggestion] = useState();
const [loading, setLoading] = useState();
- 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 add_comment
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def add_comment
unless changed.any? { |c| %w[brand_name line_name ink_name].include?(c) }
return
end
return unless comment.blank?
- 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 redirect_after_change
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def redirect_after_change
if request.referrer.blank? || request.referrer =~ %r{/admins}
if InkReview.queued.exists?
redirect_to admins_reviews_path(page: params[:page])
else
- 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 index
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def index
respond_to do |format|
format.json do
clusters =
Pens::ModelMicroCluster
- 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 index
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def index
respond_to do |format|
format.json do
clusters =
MicroCluster
- 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 CurrentlyInkedTable
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const CurrentlyInkedTable = ({ currentlyInked, onLayoutChange }) => {
const columns = useMemo(
() => [
{
Header: "Pen",
- 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 privacy_link
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def privacy_link(collected_ink)
return unless user_signed_in?
return unless current_user.id == collected_ink.user_id
if collected_ink.private?
link_to(
- 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"