Showing 140 of 140 total issues
Avoid too many return
statements within this function. Open
return constants.STATUS_ERROR_PROCESSING_FILE;
Avoid too many return
statements within this function. Open
return response({
statusCode: 500,
body: { message: "Internal server error" },
});
Avoid too many return
statements within this function. Open
return response({
statusCode: 502,
body: {
error: error.message ? error.message : "Internal server error",
},
Function UploadSubsequentDocuments
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const UploadSubsequentDocuments = () => {
const { id } = useParams<{ id: string }>();
const { data: submission, isLoading: isSubmissionLoading } = useGetItem(id);
if (isSubmissionLoading === 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"
Further reading
Function handler
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
handler: async ({
stage,
wait,
verify,
}: {
- 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 getMainExportData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const getMainExportData = async (
filters?: opensearch.main.Filterable[],
) => {
if (!filters) 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 Webform
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function Webform() {
const { id, version } = useParams<{ id: string; version: string }>();
const { data, isLoading: isFormLoading, error } = useGetForm(id as string, version);
const { readOnly, isLoading: isReadOnlyLoading } = useReadOnlyUser();
- 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 fetchUserFromCognito
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export async function fetchUserFromCognito(
userID: string,
poolID: string,
): Promise<CognitoUserType | Error> {
const cognitoClient = new CognitoIdentityProviderClient({
- 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 constructor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
constructor(scope: Construct, id: string, props: EmailServiceStackProps) {
super(scope, id, props);
const {
project,
- 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 Field
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const Field = <TFields extends FieldValues>({
name,
index,
SLOT,
control,
- 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 useFilterState
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const useFilterState = () => {
const { data: user } = useGetUser();
const url = useOsUrl();
const isCms =
- 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 check
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
check: (checker, user) => {
if (isStateUser(user) === false) {
return 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 useOsAggregate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const useOsAggregate = () => {
const { data: user } = useGetUser();
const { state } = useOsUrl();
const aggs = useQuery({
refetchOnWindowFocus: 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 FilterableBoolean
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
}> = (props) => {
const yes = props.value === null ? false : props.value;
const no = props.value === null ? false : !props.value;
const onYes = (mhm: 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"
Further reading
Function getLambdasWithTags
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async function getLambdasWithTags(tags: Tag[]): Promise<string[]> {
const taggingClient = new ResourceGroupsTaggingAPIClient({
region,
});
- 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 dependencyCheck
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const dependencyCheck = (dep: DependencyRule, data: any) => {
const conditionMatched = dep.conditions.every((DC) => {
if (DC.type === "valueNotExist") return !data[DC.name];
if (DC.type === "expectedValue") {
return data[DC.name] === DC.expectedValue;
- 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 getFormOrigin
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const getFormOrigin: GetFormOrigin = ({ id, authority } = {}) => {
const origin =
new URLSearchParams(window.location.search).get(ORIGIN) ?? DASHBOARD_ORIGIN;
if (origin === DETAILS_ORIGIN && id && authority) {
- 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 transform
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const transform = (id: string) => {
return legacyEventSchema.transform((data) => {
// Resolve the action type based on the GSI1pk
const eventType = data?.GSI1pk?.split("OneMAC#submit")?.[1] || "";
- 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 getAttachments
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const getAttachments = <Schema extends z.ZodTypeAny>(
schema: Schema,
): [string, z.ZodObject<z.ZodRawShape, "strip">][] => {
if (schema instanceof z.ZodEffects) {
return getAttachments(schema.innerType());
- 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 DownloadAllButton
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const DownloadAllButton = ({ packageId, submissionChangelog }: DownloadAllButtonProps) => {
const { onZip, loading } = useAttachmentService({ packageId });
if (submissionChangelog?.length === 0) {
return null;
- 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"