Showing 165 of 459 total issues
Function BaseManageVariables
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function BaseManageVariables() {
const [currentTab, setCurrentTab] = useState<IntegrationsConfigurationGroup>(
IntegrationsConfigurationGroup.Constants
);
const constantsDomainMessages = useDomainMessages(
Function MetaDataSettings
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function MetaDataSettings() {
const domainMessages = useAppConfigurationDomainMessages("metadata_columns");
const metaDataColumns = useAppConfiguration("metadata_columns");
Function runValidationError
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
(values: Record<string, unknown>) => {
const validations = Object.fromEntries(
typescriptSafeObjectDotEntries(fields).map(([field, config]) => {
const validationsToRun = config.validations || [];
Function hexToOklch
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const hexToOklch = (hex: string) => {
const hexToRGB = (h: string): TRGB => {
const r: number = parseInt(h.slice(1, 3), 16);
const g: number = parseInt(h.slice(3, 5), 16);
const b: number = parseInt(h.slice(5, 7), 16);
Function getEntitySelectionConfig
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const getEntitySelectionConfig = (
entityType: EntityTypesForSelection,
preSelectedType: IColorableSelection[],
enumList$1: string[]
): IColorableSelection[] => {
Function useTableColumns
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const useTableColumns = (
entity: string
): Partial<DataStateKeys<ITableColumn[]>> => {
const portalTableColumns = usePortalTableColumns(entity);
const getEntityFieldLabels = useEntityFieldLabels(entity);
- 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 useWaitForResponseMutationOptions
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export function useWaitForResponseMutationOptions<V, R = void>(
options: IWaitForResponseMutationOptions<V, R>
) {
const queryClient = useQueryClient();
const { toast } = useToast();
- 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 runFormAction
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const runFormAction = async (
entity: string,
dataEventAction: DataEventActions,
getData: () => Promise<Record<string, unknown>>,
authProfile: IAccountProfile
Function useApi
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useApi<T>(endPoint: string, options: IUseApiOptions<T>) {
const isRestoring = useIsRestoring();
const builtOptions = buildApiOptions(options);
const router = useRouter();
Function getDbInstance
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
async getDbInstance(): Promise<Knex> {
if (DatabaseConfigDataPersistenceAdaptor._dbInstance) {
return DatabaseConfigDataPersistenceAdaptor._dbInstance;
}
Function validations
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
typescriptSafeObjectDotEntries(fields).map(([field, config]) => {
const validationsToRun = config.validations || [];
const firstFailedValidation = validationsToRun.find((validation) =>
ENTITY_VALIDATION_CONFIG[validation.validationType]?.implementation(
Function CredentialsSetup
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const CredentialsSetup: CustomNextPage = () => {
const setupCredentialsMutation = useSetupCredentialsMutation();
const isChecking = useSetupCheck([
{
Function useSyncTableState
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useSyncTableState<T>(
table: Table<Record<string, unknown>>,
overridePaginatedDataState: IPaginatedDataState<T> | undefined,
syncPaginatedDataStateOut: (params: IPaginatedDataState<T>) => void
) {
Function useStringSelections
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useStringSelections(key: string) {
const [values, set] = useSelectionStore((store) => [store.values, store.set]);
const selections = values[key] || {};
Function useWaitForResponseMutationOptions
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useWaitForResponseMutationOptions<V, R = void>(
options: IWaitForResponseMutationOptions<V, R>
) {
const queryClient = useQueryClient();
const { toast } = useToast();
Function integrationsConfigurationDetailsRequestHandler
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const integrationsConfigurationDetailsRequestHandler = (
group: IntegrationsConfigurationGroup
) => {
return requestHandler(
{
Function DetailsCanvas
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function DetailsCanvas() {
const router = useRouter();
const [closeDetailsCanvas, detailsCanvasEntity, detailsCanvasId] =
useDetailsOffCanvasStore((state) => [state.close, state.entity, state.id]);
Function EntityFormExtensionSettings
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function EntityFormExtensionSettings() {
const entity = useEntitySlug();
const domainMessages = useAppConfigurationDomainMessages(
"entity_form_extension"
Function Select
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function Select({
onChange,
options: fullOptions,
disabled,
isLoading,
- 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 EntityFormActionsSettings
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function EntityFormActionsSettings() {
const entity = useEntitySlug();
const domainMessages = useDomainMessages(
LANG_DOMAINS.INTEGRATIONS.FORM_ACTIONS
);