Showing 620 of 1,668 total issues
Function initializeDatepicker
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private initializeDatepicker() {
this.datePickerInstance?.destroy();
this.datePickerInstance = new DatePicker(
this.injector,
'#flatpickr-input',
- 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 filterAlreadyApplied
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private filterAlreadyApplied(change:WorkPackageChangeset|{ [id:string]:unknown }, filter:{ id:string, values:unknown[] }):boolean {
const value:unknown = change instanceof WorkPackageChangeset ? change.projectedResource[filter.id] : change[filter.id];
const current = _.castArray(value);
for (let i = 0; i < filter.values.length; i++) {
- 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 warnIfNoOptions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private warnIfNoOptions(values:unknown[]) {
let hasMember = false;
if (values.length === 0) {
if (this.ngSelectComponent.ngSelectInstance.searchTerm !== undefined && this.ngSelectComponent.ngSelectInstance.searchTerm !== '') {
hasMember = 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
Function buildCell
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public buildCell(workPackage:WorkPackageResource, column:QueryColumn):HTMLElement|null {
// handle relation types
if (isRelationColumn(column)) {
return this.relationCellBuilder.build(workPackage, column);
}
- 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 parse
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
parse<T>(href:string):T {
if (!href.startsWith(this.bcfApiBase)) {
throw new Error(`Cannot parse ${href} into BCF resource.`);
}
- 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 getTimeSlicesForHeader
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function getTimeSlicesForHeader(vp:TimelineViewParameters,
unit:moment.unitOfTime.DurationConstructor,
startView:Moment,
endView:Moment) {
const inViewport:[Moment, Moment][] = [];
- 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 Attachable
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function Attachable<TBase extends Constructor<HalResource>>(Base:TBase) {
return class extends Base {
public attachments:AttachmentCollectionResource;
/**
- 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 reloadSidemenu
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private reloadSidemenu(selectedQueryId:string|null):void {
const menuIdentifier:string|undefined = this.$state.current.data.sidemenuId;
if (menuIdentifier) {
const menu = (document.getElementById(menuIdentifier) as HTMLElement&TurboElement);
- 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 deferInsertion
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public deferInsertion(workPackage:WorkPackageResource):boolean {
const ancestors = workPackage.getAncestors();
// Will only defer if at least one ancestor exists
if (ancestors.length === 0) {
- 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 displayDurationForDate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected displayDurationForDate(renderInfo:RenderInfo, date:Moment):number {
const { workPackage } = renderInfo;
let duration = Number(moment.duration(workPackage.duration || 'P1D').asDays().toFixed(0));
if (workPackage.ignoreNonWorkingDays) {
- 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 buildItems
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private buildItems() {
const items = this.viewerBridgeService.shouldShowViewer
? [bcfViewerViewIdentifier, bcfCardsViewIdentifier, bcfSplitViewCardsIdentifier, bcfSplitViewTableIdentifier, bcfTableViewIdentifier]
: [bcfCardsViewIdentifier, bcfTableViewIdentifier];
- 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 too many return
statements within this method. Open
return error_result(I18n.t(:error_image_size))
Avoid too many return
statements within this method. Open
return false
Avoid too many return
statements within this method. Open
return true if browser.edge? && version < 109
Avoid too many return
statements within this method. Open
return if remaining_work.nil? || remaining_work.negative?
Avoid too many return
statements within this method. Open
return true if admin_and_all_granted_to_admin?(permissions)
Avoid too many return
statements within this function. Open
return 'warning';
Avoid too many return
statements within this function. Open
return 'minus1';
Avoid too many return
statements within this function. Open
return 'reminder';
Avoid too many return
statements within this function. Open
return 'not-supported';