Showing 635 of 1,693 total issues
Method event_type
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def self.event_type
Proc.new do |o|
journal = o.last_journal
t = "work_package"
- 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 rate_updated
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def rate_updated
o = Methods.new(self)
unless saved_change_to_valid_from?
# We have not moved a rate, maybe just changed the rate value
- 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 to_html
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def to_html
words = self.words.map { |word| h(word) }
words_add = 0
words_del = 0
dels = 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
Method head
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def head
content_tag :thead do
content_tag :tr do
FIELDS.map do |field|
concat content_tag(:th) {
- 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 compactdiffs
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def compactdiffs
diffs = []
@diffs.each do |df|
i = 0
curdiff = []
- 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 reinsert
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function reinsert(el:HTMLElement, previousIndex:number|string, container:HTMLElement) {
const prev = typeof previousIndex === 'string' ? parseInt(previousIndex, 10) : previousIndex;
const currentIndex = el.parentNode ? Array.from(el.parentNode.children).indexOf(el) : null;
const children = Array.from(container.children);
- 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 addError
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public addError(obj:HttpErrorResponse|IToast|string, additionalErrors:unknown[]|string = []):IToast|null {
let message:IToast|string;
let errors:string[];
if (typeof additionalErrors === 'string') {
- 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 handleError
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public handleError(error:unknown):void {
let message:string = this.text.internal_error;
// Angular wraps our errors into uncaught promises if
// no one catches the error explicitly. Unwrap the error in that case
- 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 updateTimeframe
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
async updateTimeframe(
fetchInfo:{ start:Date, end:Date, timeZone:string },
projectIdentifier:string|undefined,
):Promise<unknown> {
await this.requireNonWorkingDays(fetchInfo.start);
- 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 initialize
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private initialize():void {
const initialData = this.loadGonData();
if (initialData) {
if (initialData.available_search_types) {
this._tabs.next(initialData.available_search_types);
- 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 EditableInplace
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
RB.EditableInplace = (function ($) {
return RB.Object.create(RB.Model, {
displayEditor: function (editor) {
this.$.addClass("editing");
Method index
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def index
# If there are no query_props given, redirect to the default query
if params[:query_props].nil? && params[:query_id].nil?
if @project.present?
return redirect_to(
Function workPackageMeetingsCount
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function workPackageMeetingsCount(
workPackage:WorkPackageResource,
injector:Injector,
):Observable<number> {
const pathHelperService = injector.get(PathHelperService);
Method extract_params
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def extract_params(payload)
{
github_id: payload.fetch("id"),
github_user: github_user_id(payload.fetch("user")),
number: payload.fetch("number"),
Function select
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private select(area:GridArea) {
return new Promise<GridWidgetResource>((resolve, reject) => {
this.opModalService.show(
AddGridWidgetModalComponent,
this.injector,
Function ngOnInit
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
ngOnInit() {
// Get element
// We use this more complicated approach of taking the last element of the class as it allows
// to still work in case an element is duplicated by Angular.
const elements = document.getElementsByClassName(this.elementClass);
Function listenToFormSubmit
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private listenToFormSubmit() {
const form = this.elementRef.nativeElement.closest('form') as HTMLFormElement;
form.addEventListener('submit', (evt:Event) => {
if (!this.form_submitted
&& (this.nonWorkingDaysModified() || this.workingDaysModified())) {
Function initDrake
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
initDrake() {
this.setContainerTargetsAndConfigs();
// reinit drake if it already exists
if (this.drake) {
Function ngOnInit
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
ngOnInit():void {
this.observeWorkPackage();
const wpId = this.$state.params.workPackageId as string;
const focusedWP = this.wpTableFocus.focusedWorkPackage;
Function updateWorkPackageCreationState
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private updateWorkPackageCreationState(change:WorkPackageChangeset) {
const resource = change.projectedResource;
if (!this.currentProject.inProjectContext) {
this.projectContext.field = this.getFields(change, ['project']);
this.workPackage.project = resource.project as HalResource;