Enterprise-CMCS/macpro-mako

View on GitHub

Showing 222 of 222 total issues

Identical blocks of code found in 2 locations. Consider refactoring.
Open

export class Storage<Key extends string = string> {
private [STORAGE_MAP_SYMBOL]: Map<Key, string>;
 
constructor() {
this[STORAGE_MAP_SYMBOL] = new Map<Key, string>();
Severity: Major
Found in mocks/data/users/mockStorage.ts and 1 other location - About 2 days to fix
react-app/src/utils/test-helpers/mockStorage.ts on lines 5..66

Identical blocks of code found in 2 locations. Consider refactoring.
Open

export class Storage<Key extends string = string> {
private [STORAGE_MAP_SYMBOL]: Map<Key, string>;
 
constructor() {
this[STORAGE_MAP_SYMBOL] = new Map<Key, string>();
Severity: Major
Found in react-app/src/utils/test-helpers/mockStorage.ts and 1 other location - About 2 days to fix
mocks/data/users/mockStorage.ts on lines 5..66

Function identityProviderServiceHandler has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
Open

>(/https:\/\/cognito-idp.\S*.amazonaws.com\//, async ({ request }) => {
console.log("identityProviderServiceHandler", { request, headers: request.headers });
const target = request.headers.get("x-amz-target");
if (target) {
if (target == "AWSCognitoIdentityProviderService.InitiateAuth") {
Severity: Minor
Found in mocks/handlers/aws/cognito.ts - About 1 day to fix

Identical blocks of code found in 2 locations. Consider refactoring.
Open

it("should display the SPA tab initially", async () => {
const isWaiver = false;
const spaTab = screen.queryByRole("heading", { level: 2, name: "SPAs" });
expect(spaTab).toBeInTheDocument();
expect(spaTab.parentElement.getAttribute("aria-selected")).toEqual("true");
Severity: Major
Found in react-app/src/features/dashboard/index.test.tsx and 1 other location - About 1 day to fix
react-app/src/features/dashboard/index.test.tsx on lines 166..179

Identical blocks of code found in 2 locations. Consider refactoring.
Open

it("should display the SPA tab initially", async () => {
const isWaiver = false;
const spaTab = screen.queryByRole("heading", { level: 2, name: "SPAs" });
expect(spaTab).toBeInTheDocument();
expect(spaTab.parentElement.getAttribute("aria-selected")).toEqual("true");
Severity: Major
Found in react-app/src/features/dashboard/index.test.tsx and 1 other location - About 1 day to fix
react-app/src/features/dashboard/index.test.tsx on lines 261..274

Identical blocks of code found in 2 locations. Consider refactoring.
Open

state: async (
variables:
| (Events["CapitatedInitial"] & CommonEmailVariables & { emails: EmailAddresses })
| (Events["ContractingInitial"] & CommonEmailVariables & { emails: EmailAddresses })
| (Events["CapitatedRenewal"] & CommonEmailVariables & { emails: EmailAddresses })
Severity: Major
Found in lib/libs/email/content/newSubmission/index.tsx and 1 other location - About 1 day to fix
lib/libs/email/content/newSubmission/index.tsx on lines 62..83

Identical blocks of code found in 2 locations. Consider refactoring.
Open

cms: async (
variables:
| (Events["CapitatedInitial"] & CommonEmailVariables & { emails: EmailAddresses })
| (Events["ContractingInitial"] & CommonEmailVariables & { emails: EmailAddresses })
| (Events["CapitatedRenewal"] & CommonEmailVariables & { emails: EmailAddresses })
Severity: Major
Found in lib/libs/email/content/newSubmission/index.tsx and 1 other location - About 1 day to fix
lib/libs/email/content/newSubmission/index.tsx on lines 84..105

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) {
Severity: Minor
Found in react-app/src/components/RHF/utils/validator.ts - About 7 hrs to fix

Function valReducer has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
Open

export const valReducer = (
valSet: RegisterOptions["validate"],
rule: AdditionalRule,
index: number,
): RegisterOptions["validate"] => {
Severity: Minor
Found in react-app/src/components/RHF/utils/additionalRules.ts - About 6 hrs to fix

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);
Severity: Minor
Found in react-app/src/components/RHF/utils/validator.ts - About 6 hrs to fix

Function getColumns has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

const getColumns = (props) => {
if (!props?.user || props.user === null) {
return [];
}
return [
Severity: Minor
Found in react-app/src/features/dashboard/Lists/waivers/consts.tsx - About 4 hrs to fix

Function getColumns has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

const getColumns = (props) => {
if (!props?.user || props.user === null) {
return [];
}
return [
Severity: Minor
Found in react-app/src/features/dashboard/Lists/spas/consts.tsx - About 4 hrs to fix

Function FilterableDateRange has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

export function FilterableDateRange({ value, onChange, ...props }: Props) {
const [open, setOpen] = useState(false);
const fromValue = useMemo(() => {
return value?.gte ? format(new UTCDate(value?.gte), DATE_FORMAT) : "";
}, [value.gte]);

Function processAndIndex has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

const processAndIndex = async ({
kafkaRecords,
transforms,
topicPartition,
}: {
Severity: Minor
Found in lib/lambda/sinkChangelog.ts - About 4 hrs to fix

Identical blocks of code found in 3 locations. Consider refactoring.
Open

it("should return 400 if event body is missing", async () => {
const event = {} as APIGatewayEvent;
 
const res = await handler(event);
 
 
Severity: Major
Found in lib/lambda/item.test.ts and 2 other locations - About 3 hrs to fix
lib/lambda/getAttachmentUrl.test.ts on lines 27..35
lib/lambda/getUploadUrl.test.ts on lines 28..36

Identical blocks of code found in 3 locations. Consider refactoring.
Open

it("should return 400 if event body is missing", async () => {
const event = {} as APIGatewayEvent;
 
const res = await handler(event);
 
 
Severity: Major
Found in lib/lambda/getAttachmentUrl.test.ts and 2 other locations - About 3 hrs to fix
lib/lambda/getUploadUrl.test.ts on lines 28..36
lib/lambda/item.test.ts on lines 15..23

Identical blocks of code found in 3 locations. Consider refactoring.
Open

it("should return 400 if event body is missing", async () => {
const event = {} as APIGatewayEvent;
 
const res = await handler(event);
 
 
Severity: Major
Found in lib/lambda/getUploadUrl.test.ts and 2 other locations - About 3 hrs to fix
lib/lambda/getAttachmentUrl.test.ts on lines 27..35
lib/lambda/item.test.ts on lines 15..23

Function useFilterDrawer has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

export const useFilterDrawer = () => {
const url = useOsUrl();
const drawer = useFilterDrawerContext();
const [filters, setFilters] = useFilterState();
 
 
Severity: Minor
Found in react-app/src/components/Opensearch/main/Filtering/Drawer/hooks.ts - About 3 hrs to fix

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,
Severity: Minor
Found in lib/lambda/checkConsumerLag.ts - About 3 hrs to fix

Function identityServiceHandler has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

async ({ request }) => {
console.log("identityServiceHandler", { request, headers: request.headers });
const target = request.headers.get("x-amz-target");
if (target) {
if (target == "AWSCognitoIdentityService.GetId") {
Severity: Minor
Found in mocks/handlers/aws/cognito.ts - About 3 hrs to fix
Severity
Category
Status
Source
Language