Showing 150 of 428 total issues
Function isAuthenticatedValidationImpl
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const isAuthenticatedValidationImpl: ValidationImplType<void> = async (
req,
protectedRoute: boolean
) => {
try {
- 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 handleValidation
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
(
validate: (
value: unknown,
parameter?: unknown,
allValues?: Record<string, unknown>
- 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 useEntityCrudView
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function useEntityCrudView(entity: string) {
const entityCrudSettings = useEntityCrudSettings(entity);
const entityFields = useEntityFields(entity);
const upsertCrudSettingsMutation = useUpsertConfigurationMutation(
- 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 parseForm
has a Cognitive Complexity of 7 (exceeds 5 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"
- 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 FormFileInput
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function FormFileInput({
input,
meta,
disabled,
uploadUrl,
- 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 DetailsLayout
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function DetailsLayout({
children,
entity,
menuKey,
menuItems = [],
- 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 handleRequestError
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const handleRequestError = async (response: Response, errorMessage: string) => {
if (response.ok) {
return;
}
const error = await response.json();
- 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
Avoid too many return
statements within this function. Open
return permissions.includes(requiredPermission);
Avoid too many return
statements within this function. Open
return await ApiRequest.GET(referenceUrl(input.value));
Avoid too many return
statements within this function. Open
return input.value;
Avoid too many return
statements within this function. Open
return new Date();
Avoid too many return
statements within this function. Open
return filterType;
Avoid too many return
statements within this function. Open
return (
<ReferenceComponent
entity={entityToOneReferenceFields?.[fieldName]}
id={value as string}
displayFrom={options.displayFrom}
Avoid too many return
statements within this function. Open
return i18n._(availableOption.label);
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this function. Open
return (
<OptionTag
color={availableOption.color}
label={availableOption.label}
value={availableOption.value}
Avoid too many return
statements within this function. Open
return operatorConfig[QueryOperators.BETWEEN](
query,
column,
timeBetween
);
Function BaseManageDashboardWidget
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function BaseManageDashboardWidget({ onSave, action }: IProps) {
const dashboardId = useRouteParam("dashboardId");
const widgetId = useRouteParam("widgetId");
const activeEntities = useActiveEntities();
const widgets = useDashboardWidgets(dashboardId);
- 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 BaseEntityForm
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function BaseEntityForm({
entity,
initialValuesData,
crudAction,
allOptional,
- 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 doesPermissionAllowPermission
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const doesPermissionAllowPermission = (
permissions: string[],
requiredPermission: string,
checkGranular: boolean
): boolean => {
- 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"