Showing 165 of 459 total issues
Function CRUDDocumentation
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function CRUDDocumentation() {
return (
<DocumentationRoot>
<p>
This setting generally allows you to disable CRUD functionalities and
File select.tsx
has 264 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import type { MessageDescriptor } from "@lingui/core";
import { msg } from "@lingui/macro";
import { useLingui } from "@lingui/react";
import * as SelectPrimitive from "@radix-ui/react-select";
import * as React from "react";
Function UsersLinkToDatabaseDocumentation
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function UsersLinkToDatabaseDocumentation() {
return (
<DocumentationRoot>
<p>
Linking your DashPress users to your database allows you to write
Function DateSettings
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function DateSettings() {
const domainMessages = useAppConfigurationDomainMessages(
"default_date_format"
);
Function EntityRelationTable
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function EntityRelationTable() {
const parentEntity = useEntitySlug();
const entityId = useEntityId();
const { _ } = useLingui();
const childEntity = useRouteParam("childEntity");
Function RolePermissions
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function RolePermissions() {
const activeEntities = useActiveEntities();
const portalPermission = usePortalExtendedPermissions();
const rolePermissions = useRolePermissions();
const portalUserPermissions = usePortalUserPermissions();
Function useEntityFieldValidations
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function useEntityFieldValidations(entity: string) {
const entityValidationsMap = useEntityConfiguration(
"entity_validations",
entity
);
Function ViewsDocumentation
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function ViewsDocumentation() {
return (
<DocumentationRoot>
<p>
Views enable you to implement query tabs. Say you have an{" "}
Function select
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
select: (data: any) => {
let returnData: T[] = data as unknown as T[];
if (dataState.filters) {
returnData = returnData.filter((datum) => {
return dataState.filters.every(($filter) => {
File Form.tsx
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import type { MessageDescriptor } from "@lingui/core";
import { msg } from "@lingui/macro";
import arrayMutators from "final-form-arrays";
import { Fragment } from "react";
import { Field, Form, useField } from "react-final-form";
Function useNavigationStack
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const useNavigationStack = () => {
const router = useRouter();
const { _ } = useLingui();
const [history, setHistory] = useNavigationHistoryStore((store) => [
Function SystemSettings
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function SystemSettings() {
const systemSettings = useAppConfiguration("system_settings");
const domainMessages = useAppConfigurationDomainMessages("system_settings");
const documentationActionButton = useDocumentationActionButton(
Function formatIntrospectData
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private formatIntrospectData(rawEntity: Entity[]): IDBSchema[] {
const dbSchema = rawEntity
.filter(({ name }) => !name.startsWith("dashpress"))
.map((entity) => {
return {
Function parseForm
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function parseForm(
req: NextApiRequest
): Promise<{ fields: formidable.Fields; files: formidable.Files }> {
const fileUploadSettings = await configurationApiService.show(
"file_upload_settings"
Function EntitiesSettings
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function EntitiesSettings() {
const domainMessages = useAppConfigurationDomainMessages("disabled_entities");
const entitiesList = useEntitiesList();
useSetPageDetails({
Function viewSpecialDataTypes
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
export const viewSpecialDataTypes = ({
fieldName,
value,
entityToOneReferenceFields = {},
entityFieldSelections = {},
- 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 EntityDetails
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function EntityDetails() {
const entityId = useEntityId();
const entity = useEntitySlug();
const entityCrudConfig = useEntityCrudConfig(entity);
const dataDetails = useEntityDataDetails({ entity, entityId });
Function useApiMutateOptimisticOptions
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function useApiMutateOptimisticOptions<T, V, R = void>(
options: IApiMutateOptions<T, V, R>
) {
const apiMutate = useApiMutate<T>(options.dataQueryPath);
const queryClient = useQueryClient();
Function reducer
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const reducer = (state: State, action: Action): State => {
switch (action.type) {
case "ADD_TOAST":
return {
...state,
Function TableViewsSettings
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function TableViewsSettings() {
const entity = useEntitySlug();
const domainMessages = useAppConfigurationDomainMessages("table_views");
const upsertTableViewsMutation = useUpsertConfigurationMutation(