Showing 124 of 140 total issues
Function FilterableDateRange
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
export function FilterableDateRange({ value, onChange, ...props }: Props) {
const [open, setOpen] = useState(false);
const selectedDate = useMemo(() => {
return {
from: value?.gte ? offsetFromUtc(new Date(value?.gte)) : undefined,
- 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 slotValidator
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
(data: any) =>
(ACC: ERROR, SLOT: RHFSlotProps): ERROR => {
const optionValidator = (OPT: RHFOption) => {
if (OPT.form) OPT.form.reduce(formGroupValidator(data), ACC);
if (OPT.slots) {
- 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 useWaiverTableColumns
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
export const useWaiverTableColumns = (): OsTableColumn[] => {
const { data: props } = useGetUser();
if (!props?.user) return [];
- 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 validateInput
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
export const validateInput = (inputValue: any, rules?: RegisterOptions) => {
const isEmpty =
isUndefined(inputValue) ||
inputValue === "" ||
(Array.isArray(inputValue) && !inputValue.length);
- 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 valReducer
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
export const valReducer = (
valSet: RegisterOptions["validate"],
rule: AdditionalRule,
index: number,
): RegisterOptions["validate"] => {
- 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 useSpaTableColumns
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
export const useSpaTableColumns = (): OsTableColumn[] => {
const { data: props } = useGetUser();
if (!props?.user) return [];
- 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 handler
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
export const handler: Handler = async (event, _, callback) => {
const response = {
statusCode: 200,
stable: false,
current: false,
- 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 useFilterDrawer
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
export const useFilterDrawer = () => {
const url = useOsUrl();
const drawer = useFilterDrawerContext();
const [filters, setFilters] = useFilterState();
- 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 updateUserAttributes
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
async function updateUserAttributes(params: any): Promise<void> {
try {
// Fetch existing user attributes
const getUserCommand = new AdminGetUserCommand({
UserPoolId: params.UserPoolId,
- 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 updateUserAttributes
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export async function updateUserAttributes(params: any): Promise<void> {
try {
// Fetch existing user attributes
const getUserCommand = new AdminGetUserCommand({
UserPoolId: params.UserPoolId,
- 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 OsExportData
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
}> = ({ columns, disabled }) => {
const [loading, setLoading] = useState(false);
const url = useOsUrl();
const handleExport = async () => {
- 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 processAndIndex
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
const processAndIndex = async ({
kafkaRecords,
index,
osDomain,
transforms,
- 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 processAndIndex
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
const processAndIndex = async ({
kafkaRecords,
index,
osDomain,
transforms,
- 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 handler
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export const handler: Handler = async (event, _, callback) => {
console.log("request:", JSON.stringify(event, undefined, 2));
const response = {
statusCode: 200,
};
- 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 ActionForm
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export const ActionForm = <Schema extends SchemaWithEnforcableProps>({
schema,
defaultValues,
title,
fields: Fields,
- 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 triggerCheckSwitch
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const triggerCheckSwitch = (
dependentValue: unknown[],
d: Condition,
i: number,
) => {
- 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 initializeResources
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private initializeResources(props: DataStackProps): {
openSearchDomainArn: string;
openSearchDomainEndpoint: string;
} {
const {
- 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 slotInitializer
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
(parentId?: string) =>
(ACC: GL, SLOT: RHFSlotProps): GL => {
const adjustedName = `${parentId ?? ""}${SLOT.name}`;
const optionReducer = (OPT: RHFOption) => {
- 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 initializeResources
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private initializeResources(props: ApiStackProps): {
apiGateway: cdk.aws_apigateway.RestApi;
} {
const { project, stage, isDev, stack } = props;
const {
- 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 recordDetails
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const recordDetails = (data: opensearch.main.Document): DetailSectionItem[] => [
{
label: "Submission ID",
value: data.id,
canView: () => true,
- 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"