Showing 635 of 1,693 total issues
Class Results
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class ::Query::Results
include ::Query::Results::GroupBy
include ::Query::Results::Sums
include Redmine::I18n
Class Budget
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class Budget < ApplicationRecord
belongs_to :author, class_name: "User"
belongs_to :project
has_many :work_packages, dependent: :nullify
has_many :material_budget_items, -> {
Class CreateContract
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class CreateContract < ::ModelContract
include ::Bim::Bcf::Concerns::ManageBcfGuarded
WHITELISTED_PROPERTIES = %w(guid
index
ConfigurationService
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
@Injectable({ providedIn: 'root' })
export class ConfigurationService {
// fetches configuration from the ApiV3 endpoint
// TODO: this currently saves the request between page reloads,
// but could easily be stored in localStorage
Function initializeUiRouterListeners
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function initializeUiRouterListeners(injector:Injector) {
const $transitions:TransitionService = injector.get(TransitionService);
const stateService = injector.get(StateService);
const toastService:ToastService = injector.get(ToastService);
const currentProject:CurrentProjectService = injector.get(CurrentProjectService);
Method controller_work_package_new_after_save
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def controller_work_package_new_after_save(context = {})
params = context[:params]
work_package = context[:work_package]
return unless work_package.backlogs_enabled?
- 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 update
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def update
wiki_menu_setting = wiki_menu_item_params[:setting]
parent_wiki_menu_item = params[:parent_wiki_menu_item]
get_data_from_params(params)
- 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 22 (exceeds 5 allowed). Consider refactoring. Open
private buildItems() {
this.items = [
{
// Configuration modal
disabled: false,
- 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 selectPreviousResult
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
private selectPreviousResult(activeID:ID|null, allProjects:IProjectData[]):void {
if (activeID === null) {
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
File chronic_duration.spec.ts
has 294 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* NOTE:
* Changes to this file should be kept in sync with
* lib/chronic_duration_spec.rb.
Function buildQueries
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
public buildQueries():IStaticQuery[] {
let items:IStaticQuery[] = [
{
title: this.text.all_open,
uiSref: 'work-packages',
Function makeSplitViewRoutes
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function makeSplitViewRoutes(baseRoute:string,
menuItemClass:string|undefined,
showComponent:ComponentType<unknown>,
newComponent:ComponentType<unknown> = WorkPackageNewSplitViewComponent,
makeFullWidth?:boolean,
StorageComponent
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
@Component({
selector: 'op-storage',
templateUrl: './storage.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [{ provide: OpUploadService, useClass: StorageUploadService }],
Function initializeGlobalListeners
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function initializeGlobalListeners():void {
document
.documentElement
.addEventListener('click', (evt:MouseEvent) => {
const target = evt.target as HTMLElement;
Method search
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def search(tokens, projects = nil, options = {})
tokens = Array(tokens)
projects = [] << projects unless projects.nil? || projects.is_a?(Array)
find_order = "#{searchable_options[:order_column]} " + (options[:before] ? "DESC" : "ASC")
- 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
Class HistoricActiveRecordRelation
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class Journable::HistoricActiveRecordRelation < ActiveRecord::Relation
attr_accessor :timestamp
include ActiveRecord::Delegation::ClassSpecificRelation
TopMenuService
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
@Injectable({ providedIn: 'root' })
export class TopMenuService {
private hover = false;
private menuIsOpen = false;
TimezoneService
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
@Injectable({ providedIn: 'root' })
export class TimezoneService {
constructor(
readonly configurationService:ConfigurationService,
readonly I18n:I18nService,
Function ngOnInit
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
ngOnInit():void {
this.form.disable();
this.eeShowBanners = this.bannersService.eeShowBanners;
this
Function listenToSettingChanges
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function listenToSettingChanges() {
jQuery('#settings_session_ttl_enabled').on('change', function () {
jQuery('#settings_session_ttl_container').toggle(jQuery(this).is(':checked'));
}).trigger('change');