Showing 12 of 45 total issues
Function getGlobalConfig
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getGlobalConfig(env = process.env): GlobalCLIConfig {
const normalEnv = normalizeEnviromentVariables(env);
return {
'gb-token': {
Function getManyMore
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
async function getManyMore<
T extends Record<string, unknown>[],
E extends boolean,
P extends PaginationTypes = PaginationTypes,
>(
- 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 edit
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
edit<E extends boolean = false>(
planName: string,
options: ApplicationPlanLimitOptions & Sudo & ShowExpanded<E> = {},
): Promise<GitlabAPIResponse<ApplicationPlanLimitSchema, C, E, void>> {
const {
Function getManyMore
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function getManyMore<
T extends Record<string, unknown>[],
E extends boolean,
P extends PaginationTypes = PaginationTypes,
>(
Function defaultRequestHandler
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export async function defaultRequestHandler(endpoint: string, options?: RequestOptions) {
const retryCodes = [429, 502];
const maxRetries = 10;
const { prefixUrl, asStream, searchParams, rateLimiters, method, ...opts } = options || {};
const rateLimit = getMatchingRateLimiter(endpoint, rateLimiters, method);
- 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 get
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function get<
T extends ResponseBodyTypes = Record<string, unknown>,
>(): getOverloadImproved<T> {
return async <C extends boolean, E extends boolean>(
service: BaseResource<C>,
Function defaultRequestHandler
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function defaultRequestHandler(endpoint: string, options?: RequestOptions) {
const retryCodes = [429, 502];
const maxRetries = 10;
const { prefixUrl, asStream, searchParams, rateLimiters, method, ...opts } = options || {};
const rateLimit = getMatchingRateLimiter(endpoint, rateLimiters, method);
Function getManyMore
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
camelize: boolean,
getFn: RequestHandlerFn<T>,
endpoint: string,
response: FormattedResponse<T>,
requestOptions: { maxPages?: number } & PaginationRequestOptions<P> & BaseRequestOptions<E>,
Function url
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
resourceId: number | string,
resourceType2: string,
resourceId2: number | string,
noteId: number,
awardId?: number,
Function defaultOptionsHandler
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export async function defaultOptionsHandler(
resourceOptions: ResourceOptions,
{
body,
searchParams,
- 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 edit
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
edit<E extends boolean = false>(
{
logo,
pwaIcon,
...options
- 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({
sudo,
profileToken,
camelize,
requesterFn,
- 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"