Showing 7 of 7 total issues
Function updateClientInstance
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
const updateClientInstance = <C extends grpc.Client>(
grpcClient: C
): UpdatedClient<C> => {
const resClient: any = {}
for (const rpcName in grpcClient) {
Function wrapToHandler
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
const wrapToHandler = (
methodDefinition: grpc.MethodDefinition<any, any>,
methodHandler: any
) => {
const type = stubToType(methodDefinition)
Function Home
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Home() {
const context = useDocusaurusContext()
const { siteConfig = {} } = context
return (
<Layout
Function createCache
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
<E = unknown>(
/** Response binary cache implementation */
cache: CacheImplementation<E>,
/** Optional callback to react on cache miss/hit. Called once per request ASAP after cache retrieval */
cb?: (
- 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 updateClientInstance
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const updateClientInstance = <C extends grpc.Client>(
grpcClient: C
): UpdatedClient<C> => {
const resClient: any = {}
for (const rpcName in grpcClient) {
- 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 composeMiddleware
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const composeMiddleware = (middleware: Middleware[]): Middleware => {
return async (call, next) => {
const dispatch = async (i: number): Promise<void> => {
// TODO: Maybe throw / log on repeated next
const fn = i === middleware.length ? next : middleware[i]
- 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 createClient
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const createClient = <
D extends
| (new (...args: any[]) => grpc.Client)
| Record<string, new (...args: any[]) => grpc.Client>
>(
- 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"