Showing 635 of 1,693 total issues
Function render
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public render() {
// If no relation column active, skip this pass
if (!this.isApplicable) {
return;
}
Function initializeViews
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
private initializeViews():void {
const categories:{ [category:string]:IOpSidemenuItem[] } = {
starred: [],
default: [],
public: [],
Function wpOnboardingTourSteps
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function wpOnboardingTourSteps():OnboardingStep[] {
return [
{
'next .wp-table--row': I18n.t('js.onboarding.steps.wp.list'),
showSkip: false,
Method change
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def change
create_table :gitlab_merge_requests do |t|
t.references :gitlab_user
t.references :merged_by
Method up
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def up
if primary_key_index_name(:cost_objects) != "cost_objects_pkey"
warn "Found unexpected primary key name. Fixing primary key names..."
require "./db/migrate/20190502102512_ensure_postgres_index_names"
Method patch
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def patch(diff)
newary = nil
newary = if diff.difftype == String
diff.difftype.new("")
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 push
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def push(name, url, options = {})
options = options.dup
if options[:parent]
subtree = find(options[:parent])
- 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 14 (exceeds 5 allowed). Consider refactoring. Open
private buildItems() {
this.items = [];
if (this.wpDisplayRepresentationService.current !== wpDisplayCardRepresentation) {
this.items.push(
- 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 determineParent
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private determineParent(el:Element):Promise<string|null> {
let previous = el.previousElementSibling;
const next = el.nextElementSibling;
let parent = null;
- 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 down
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def down
rename_column :material_budget_items, :amount, :budget
rename_column :material_budget_items, :budget_id, :cost_object_id
rename_column :labor_budget_items, :amount, :budget
rename_column :labor_budget_items, :budget_id, :cost_object_id
Method core_user_tabs
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def core_user_tabs
[
{
name: "general",
partial: "users/general",
Function ngOnInit
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
ngOnInit():void {
if (!(this.resource instanceof HalResource)) {
// Parse the resource if any exists
this.resource = this.halResourceService.createHalResource(this.resource, true);
}
Function buildInsertPosition
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function buildInsertPosition(
order:string[],
positions:QueryOrder,
wpId:string,
index:number,
Function getFilterName
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public getFilterName(timestamps:string[]) {
const datesAndTimes = timestamps.map((el) => el.split(/[@T]/));
const baselineValue = baselineFilterFromValue(this.wpTableBaseline.current);
const changesSinceOrBetween = this.deriveChangesSinceOrBetween(baselineValue);
let description = '';
Function ngOnInit
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
ngOnInit():void {
this.form = this.rootFormGroup.control.get('dailyReminders') as UntypedFormGroup;
this.enabled$ = this
.form
Function initializeLocale
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function initializeLocale() {
const meta = document.querySelector<HTMLMetaElement>('meta[name=openproject_initializer]');
const userLocale = meta?.dataset.locale || 'en';
const defaultLocale = meta?.dataset.defaultlocale || 'en';
const instanceLocale = meta?.dataset.instancelocale || 'en';
Function buildItems
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
private buildItems() {
this.items = [
{
// Configuration modal
linkText: this.I18n.t('js.toolbar.settings.configure_view'),
Consider simplifying this complex logical expression. Open
if (
changes.settings
|| changes.resourcePath
|| changes.resourceId
|| changes.formUrl
Consider simplifying this complex logical expression. Open
if (inGroup || isRoot) {
const elementGroups = Array.from(element.classList).filter((listClass) => listClass.includes('__hierarchy-group-')) || [];
const previousGroups = Array.from(previous.classList).filter((listClass) => listClass.includes('__hierarchy-group-')) || [];
const nextGroups = next && Array.from(next.classList).filter((listClass) => listClass.includes('__hierarchy-group-')) || [];
const previousWpId = (previous as HTMLElement).dataset.workPackageId!;
Method replacements
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.replacements
[
{ class: WorkPackage, column: :description },
{ class: Journal::WorkPackageJournal, column: :description },
{ class: Document, column: :description },