Showing 157 of 428 total issues
Function RolePermissions
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function RolePermissions() {
const activeEntities = useActiveEntities();
const portalPermission = usePortalExtendedPermissions();
const rolePermissions = useRolePermissions();
const portalUserPermissions = usePortalUserPermissions();
Function ConfirmAlert
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function ConfirmAlert() {
const rootRef = useRef<HTMLDivElement>(null);
const { _ } = useLingui();
const [title, action, onClose] = useConfirmAlertStore((store) => [
Function useEntityFieldValidations
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useEntityFieldValidations(entity: string) {
const entityValidationsMap = useEntityConfiguration(
"entity_validations",
entity
);
Function ViewsDocumentation
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function ViewsDocumentation() {
return (
<DocumentationRoot>
<p>
Views enable you to implement query tabs. Say you have an{" "}
Function EntityRelationTable
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function EntityRelationTable() {
const parentEntity = useEntitySlug();
const entityId = useEntityId();
const { _ } = useLingui();
const childEntity = useRouteParam("childEntity");
File Form.tsx
has 259 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { QueryFilterSchema } from "shared/types/data";
import { Form, Field, useField } from "react-final-form";
import arrayMutators from "final-form-arrays";
import { FieldArray } from "react-final-form-arrays";
import { ACTIONS_ACCESSOR } from "frontend/views/data/Table/useTableColumns";
Function select
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
select: (data: any) => {
let returnData: T[] = data as unknown as T[];
if (dataState.filters) {
returnData = returnData.filter((datum) => {
return dataState.filters.every(($filter) => {
Function FormSelect
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function FormSelect(formInput: IFormSelect) {
const {
input,
selectData,
meta,
File index.tsx
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { useId } from "react";
import { ChevronRight as ChevronRightIcon } from "react-feather";
import Link from "next/link";
import styled, { css } from "styled-components";
import { USE_ROOT_COLOR } from "frontend/design-system/theme/root";
Function DateSettings
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function DateSettings() {
const domainMessages = useAppConfigurationDomainMessages(
"default_date_format"
);
Function ListManagerItem
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export function ListManagerItem({
label,
systemIcon,
disabled,
subLabel,
- 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 Table
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export function Table<T extends unknown>({
overridePaginatedDataState,
tableData,
syncPaginatedDataStateOut,
columns,
- 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 useNavigationStack
has 52 lines of code (exceeds 25 allowed). Consider refactoring. 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
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
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
export async function parseForm(
req: NextApiRequest
): Promise<{ fields: formidable.Fields; files: formidable.Files }> {
const fileUploadSettings = await configurationApiService.show(
"file_upload_settings"
Function NavigationSkeleton
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function NavigationSkeleton() {
const getThemeColorShade = useThemeColorShade();
const SCHEMA = [
"header",
Function EntitiesSettings
has 48 lines of code (exceeds 25 allowed). Consider refactoring. 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
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 AsyncFormSelect
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export function AsyncFormSelect(props: IProps) {
const {
input,
url,
referenceUrl,
- 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"