Showing 150 of 428 total issues
Function EntityCrudSettings
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function EntityCrudSettings() {
const tabFromUrl = useRouteParam("tab");
const changeTabParam = useChangeRouterParam("tab");
const entity = useEntitySlug();
Function Template
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Template: Story<ITableProps<unknown>> = (args) => {
const [paginatedDataState, setPaginatedDataState] = useState<
IPaginatedDataState<any>
>({ ...DEFAULT_TABLE_STATE });
Function crudEnabledValidationImpl
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const crudEnabledValidationImpl: ValidationImplType<void> = async (
req,
action: unknown
) => {
progammingError("Please provide the action for the CRUD check", !action);
Function listData
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
async listData(
entity: string,
searchValue?: string
): Promise<{ value: string; label: string }[]> {
const [relationshipSettings, primaryField] = await Promise.all([
Function useWaitForResponseMutationOptions
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useWaitForResponseMutationOptions<V, R = void>(
options: IWaitForResponseMutationOptions<V, R>
) {
const queryClient = useQueryClient();
Function defaultWidgets
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
.map(async (entity, index) => {
const dateField =
await this._entitiesApiService.getEntityFirstFieldType(
entity.value,
"date"
Function StorageIntegrations
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function StorageIntegrations() {
const fileStorageDomainMessages = useDomainMessages(
LANG_DOMAINS.INTEGRATIONS.FILE_STORAGE
);
useSetPageDetails({
Function filterOperatorToQuery
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
filterOperatorToQuery(
query: T,
column: string,
{ operator, value, value2 }: IColumnFilterBag<unknown>,
groupOperator: "and" | "or"
- 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 EntityRelationDetails
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function EntityRelationDetails() {
const childEntity = useRouteParam("childEntity");
const childEntityCrudConfig = useEntityCrudConfig(childEntity);
const entityId = useEntityId();
const parentEntity = useEntitySlug();
- 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 useTableState
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useTableState = (
contextKey: string,
persistentFilters: IDataTableProps["persistentFilters"],
defaultTableState?: IDataTableProps["defaultTableState"]
) => {
Function create
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
async create(
entity: string,
data: Record<string, unknown>,
accountProfile: IAccountProfile
): Promise<string | number> {
Function render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { error } = this.state;
const { children } = this.props;
if (error) {
return (
Function AccountProfile
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function AccountProfile() {
const authenticatedUserBag = useAuthenticatedUserBag();
const updateProfileMutation = useUpdateProfileMutation();
const domainMessages = useDomainMessages(LANG_DOMAINS.ACCOUNT.PROFILE);
Function GET
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
GET: async (): Promise<Record<string, string>> => {
const latestVersion$1 = await latestVersion("dashpress");
const versionText =
latestVersion$1 === version
Function createConfigDomainPersistenceService
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function createConfigDomainPersistenceService<T>(
configDomain: ConfigDomain
): AbstractConfigDataPersistenceService<T> {
const configBag: Record<
ConfigAdaptorTypes,
Function showData
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
async showData(
entity: string,
id: string | number,
column?: string
): Promise<Record<string, unknown>> {
Function getEntitySelections
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const getEntitySelections = (
entityFields: IEntityField[],
entitySelections: Record<string, IColorableSelection[]>,
entityFieldTypes: Record<string, FormFieldTypes>
): Record<string, IColorableSelection[]> => {
Function ListManager
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function ListManager<T, K extends StringProps<T>>({
labelField,
listLengthGuess,
getLabel,
items,
- 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 WidgetFrame
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
({ setting, config, type, data, isPreview, Component }, ref) => {
const navigationLink = useWidgetNavigationLink(
config.entity,
config.queryId
);
- 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 useApiMutateOptimisticOptions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function useApiMutateOptimisticOptions<T, V, R = void>(
options: IApiMutateOptions<T, V, R>
) {
const apiMutate = useApiMutate<T>(options.dataQueryPath);
const queryClient = useQueryClient();
- 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"