Showing 628 of 1,682 total issues
Method replacenextlarger
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def replacenextlarger(value, high = nil)
high ||= length
if empty? || value > self[-1]
push value
return high
- 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 makediff
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def makediff(a, b)
mvector = self.class.lcs(a, b)
ai = bi = 0
while ai < mvector.length
bline = mvector[ai]
- 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 compare
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def compare(first, second)
first = Array(first).flatten
second = Array(second).flatten
first.zip second do |a, b|
return (a <=> b) || (a == Infinity ? 1 : -1) if a != b
- 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 load_custom_values_values
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def load_custom_values_values(work_package)
work_package.custom_values.each do |cv|
next unless cv.custom_field && cv.value.present?
loaded_value = case cv.custom_field.field_format
- 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 register
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def register # rubocop:disable Metrics/AbcSize
@device_type = params[:key].to_sym
@device = new_device_type! @device_type
needs_confirmation = true
- 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 playground
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def playground(show_filter_input: true, show_filter_button: true, show_action_button: true, text: "Monday, 12th")
render(Primer::OpenProject::SubHeader.new) do |component|
component.with_filter_input(name: "filter", label: "Filter") if show_filter_input
if show_filter_button
component.with_filter_button do |button|
- 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_row
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def add_row(arr, idx = nil)
idx ||= [@sheet.last_row_index + 1, 1].max
column_array = []
arr.each_with_index do |c, i|
value = if %w(Time Date Float Integer).include?(c.class.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
Function constructor
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
constructor(public readonly injector:Injector,
protected readonly elementRef:ElementRef,
protected readonly $transitions:TransitionService,
protected readonly ConfigurationService:ConfigurationService,
protected readonly editingPortalService:EditingPortalService,
- 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 onMove
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public onMove(event:any) {
if (!this.autoScroll()) {
return;
}
- 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 buildPayloadFromChanges
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected buildPayloadFromChanges() {
let payload:unknown&{ _links:{ attachments?:IHalOptionalTitledLink[], fileLinks?:IHalOptionalTitledLink[] } };
if (isNewResource(this.pristineResource)) {
// If the resource is new, we need to pass the entire form payload
- 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 updateLabels
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected updateLabels(activeDragNDrop:boolean,
labels:WorkPackageCellLabels,
change:WorkPackageChangeset) {
const labelConfiguration = this.wpTableTimeline.getNormalizedLabels(change.projectedResource);
- 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 initializeGlobalListeners
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function initializeGlobalListeners():void {
document
.documentElement
.addEventListener('click', (evt:MouseEvent) => {
const target = evt.target as HTMLElement;
- 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 toggleNavigation
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public toggleNavigation(event?:JQuery.TriggeredEvent|Event):void {
if (event) {
event.stopPropagation();
event.preventDefault();
}
- 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 listParamsString
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function listParamsString(params?:ApiV3ListParameters):string {
const queryProps = [];
if (params && params.sortBy) {
queryProps.push(`sortBy=${JSON.stringify(params.sortBy)}`);
- 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 makeSplitViewRoutes
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
export function makeSplitViewRoutes(baseRoute:string,
menuItemClass:string|undefined,
showComponent:ComponentType<unknown>,
newComponent:ComponentType<unknown> = WorkPackageNewSplitViewComponent,
makeFullWidth?:boolean,
Avoid deeply nested control flow statements. Open
if (opts.weeks) {
if (units.days >= daysPerWeek) {
units.weeks = Math.trunc(units.days / daysPerWeek);
units.days = Math.trunc(units.days % daysPerWeek);
if (units.weeks >= FULL_WEEKS_PER_MONTH) {
Avoid deeply nested control flow statements. Open
if node.left == model.arel_table
node.left = model.journal_class.arel_table
end
Method build_header_cells_parts
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def build_header_cells_parts(columns, top, height, mapping_lambda, compare_lambda, title_lambda)
Method options
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def options(*names)
default_values = {}
if names.size == 1 && names.first.is_a?(Hash)
default_values = names.first
- 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 Taskboard
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
RB.Taskboard = (function ($) {
return RB.Object.create(RB.Model, {
initialize: function (el) {
var self = this; // So we can bind the event handlers to this object
- 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"