Factor shared before_actions/filters/error handling into ApplicationController or a base controller.
duplication-complexitymodule-architecture
Low
Define dialog handlers once to avoid duplication
For confirm/cancel flows, define common callbacks (confirm/cancel) once and reuse across dialogs.
duplication-complexitystack-flutter+1
Low
Define hardcoded strings as shared constants
Replace magic strings with constants or enums sealed classes; keep them in a single source of truth.
duplication-complexitymaintainability+1
Low
Define reusable constants for repeated values
Create theme-like constants (radii, gaps, durations) and reuse across widgets.
duplication-complexitymaintainability+2
Low
Derive TypeScript types from validation schemas
Avoid duplicating runtime schemas and TypeScript types; derive types from constants/functions or declare as const tuples.
duplication-complexitystyle-conventions
Low
DON'T explicitly title libraries
Ensure that libraries are not explicitly titled. Dart provides automatic library titles, so avoid redundant naming of libraries in the code.
duplication-complexitystack-flutter+1
Low
Extract common parallel processing patterns
Encapsulate coroutine parallelization (map async/awaitAll, limited concurrency) into utilities.
concurrency-safetyduplication-complexity+1
Low
Extract common query logic
Factor repeated LINQ predicates/projections into reusable expressions or methods.
duplication-complexityreadability-refactor
Low
Extract duplicated API call logic
Factor repeated HTTP call setup/parsing/retry into a reusable helper or client.
duplication-complexitymodule-architecture
Low
Extract duplicated business logic
Move repeated domain rules into reusable methods/services; keep controllers and handlers thin.
duplication-complexitymodule-architecture+1
Low
Extract duplicated business logic
Move repeated domain calculations/transformations into named functions or service classes; keep controllers/scripts thin.
duplication-complexitymodule-architecture+1
Low
Extract duplicated business logic to models
Move domain behavior from controllers/views into models or service objects.
duplication-complexitymodule-architecture
Low
Extract duplicated field lists to constants
When the same set of attribute/field names is used in multiple places (strong params, serializers, queries), extract it to a constant and reuse.
duplication-complexitymaintainability
Low
Extract duplicated interaction handlers
Factor common interaction/message handling into reusable functions or classes with parameters for the differing bits.
duplication-complexityreadability-refactor
Low
Extract duplicated logic into functions
Duplicate sequences of statements must be extracted into a named function or utility.
duplication-complexityreadability-refactor
Low
Extract duplicated logic to helper functions
Move repeated sequences of operations into named helpers or utilities and reuse them.
duplication-complexitymaintainability+2
Low
Extract duplicated request validation to helper functions
For HTTP/RPC handlers, parse+validate inputs in dedicated functions. Return typed errors and reuse across endpoints.
api-conventionsduplication-complexity
Low
Extract duplicated widget logic to reusable methods
Factor identical widget trees or builders into private helpers or dedicated widgets.
duplication-complexityreadability-refactor+1
Low
Extract hardcoded versions to centralized configuration
Parameterize tool/runtime versions via ARGs (and CI build args) instead of hardcoding them across multiple Dockerfiles.
container-docker-hygieneduplication-complexity+1
Low
Extract query strings to constants
Define SQL strings as static final constants or in a repository, not inline across methods.
duplication-complexitymaintainability
Low
Extract shared Sidekiq queue names to constants
Centralize queue names and reuse across workers and tests.
duplication-complexitymaintainability
Low
Extract validation logic to separate methods
Centralize validation in dedicated functions/objects and reuse; return typed errors.
duplication-complexityerror-handling+1
Low
Keep Functions/Methods Single-Responsibility
Write functions and methods so each does one well-defined task. If a function handles distinct steps (validation, processing, saving, notifying), refactor into smaller focused functions.
duplication-complexityreadability-refactor+1
Low
Move generic helpers to ApplicationHelper
Place cross-controller view helpers in ApplicationHelper (or a shared module) for reuse.