Showing 13 of 36 total issues
File adapter.ts
has 498 lines of code (exceeds 300 allowed). Consider refactoring. Open
import {
ObjectId,
Collection,
FindOptions,
BulkWriteOptions,
File config.sidebar.ts
has 491 lines of code (exceeds 300 allowed). Consider refactoring. Open
const comparisonSidebar = [
{
text: 'Compare Feathers',
items: [
{
Function feathersExpress
has a Cognitive Complexity of 29 (exceeds 8 allowed). Consider refactoring. Open
export default function feathersExpress<S = any, C = any>(
feathersApp?: FeathersApplication<S, C>,
expressApp: Express = express()
): Application<S, C> {
if (!feathersApp) {
- 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 _find
has a Cognitive Complexity of 23 (exceeds 8 allowed). Consider refactoring. Open
async _find(params: ServiceParams = {} as ServiceParams): Promise<Paginated<Result> | Result[]> {
const { paginate } = this.getOptions(params)
const { query, filters } = this.getQuery(params)
let values = _.values(this.store)
- 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 useQuery
has a Cognitive Complexity of 19 (exceeds 8 allowed). Consider refactoring. Open
export const useQuery = <T extends FieldType>(reference: Ref<T>, field: string) => {
function getQuery() {
return queryString.parse(window.location.search, {
parseNumbers: true,
parseBooleans: 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 generate
has a Cognitive Complexity of 16 (exceeds 8 allowed). Consider refactoring. Open
export const generate = (ctx: ServiceGeneratorArguments) =>
Promise.resolve(ctx)
.then(initializeBaseContext())
.then(checkPreconditions())
.then(
- 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 resolveExternal
has a Cognitive Complexity of 15 (exceeds 8 allowed). Consider refactoring. Open
<H extends HookContext>(...resolvers: Resolver<any, H>[]) =>
async (context: H, next: NextFunction) => {
if (typeof next !== 'function') {
throw new Error('The resolveExternal hook must be used as an around hook')
}
- 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 errorHandler
has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring. Open
export function errorHandler(error: any) {
const { message } = error
let feathersError = error
if (error.sqlState && error.sqlState.length) {
- 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 redirectHook
has a Cognitive Complexity of 12 (exceeds 8 allowed). Consider refactoring. Open
export const redirectHook = () => async (context: HookContext, next: NextFunction) => {
try {
await next()
const { location } = context.result
- 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 oauth
has a Cognitive Complexity of 11 (exceeds 8 allowed). Consider refactoring. Open
(settings: Partial<OauthSetupSettings> = {}) =>
(app: Application) => {
const authService = app.defaultAuthentication ? app.defaultAuthentication(settings.authService) : null
if (!authService) {
- 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 _find
has a Cognitive Complexity of 11 (exceeds 8 allowed). Consider refactoring. Open
async _find(params: ServiceParams = {} as ServiceParams): Promise<Paginated<Result> | Result[]> {
const { filters, paginate } = this.filterQuery(params)
const { name, id } = this.getOptions(params)
const builder = params.knex ? params.knex.clone() : this.createQuery(params)
const countBuilder = builder.clone().clearSelect().clearOrder().count(`${name}.${id} as total`)
- 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 errorHandler
has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring. Open
export const errorHandler = () => async (ctx: FeathersKoaContext, next: () => Promise<any>) => {
try {
await next()
if (ctx.body === undefined) {
- 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 lookup
has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring. Open
lookup(path: string[], info: LookupData): LookupResult<T> | null {
if (path.length === this.depth) {
return this.data === undefined
? 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"