feathersjs/feathers-hooks-common

View on GitHub
src/hooks/serialize.ts

Summary

Maintainability
A
2 hrs
Test Coverage

Function serialize has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function serialize<H extends HookContext = HookContext>(
  schema1: SerializeSchema<H> | SyncContextFunction<SerializeSchema, H>,
) {
  return (context: H) => {
    const schema = typeof schema1 === 'function' ? schema1(context) : schema1;
Severity: Minor
Found in src/hooks/serialize.ts - About 1 hr to fix

    Function serializeItem has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function serializeItem(item: any, schema: any) {
          const computed: Record<string, any> = {};
          Object.keys(schema.computed || {}).forEach(name => {
            computed[name] = schema.computed[name](item, context); // needs closure
          });
    Severity: Minor
    Found in src/hooks/serialize.ts - About 1 hr to fix

      There are no issues that match your filters.

      Category
      Status