Showing 4 of 94 total issues
File nexus.ts
has 1116 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* This file was generated by Nexus Schema
* Do not make changes to this file directly
*/
Function resolve
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
resolve: async (_parent, args, ctx) => {
const userId = await getUserId(ctx);
let where: NexusGenInputs['OperationWhereInput'] | null = {};
Function getUserId
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
export async function getUserId(context: Context): Promise<string> {
const Authorization = context.request.req.get('Authorization');
if (Authorization) {
const token = Authorization.replace('Bearer ', '');
const verifiedToken = verify(token, APP_SECRET) as Token;
- 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 resolve
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
resolve: async (
parent,
{ data: { accountId, name, value, type, isPaid, paidAt, categoryId, creditCardId }, where },
ctx,
) => {
- 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"