Showing 5 of 29 total issues

Function repositoryDelete has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

export const repositoryDelete = async (
  instance: BaseEntity
): Promise<boolean> => {
  const { constructor } = getConstructorDatastoreCache(instance);
  const columnMetadatas = getColumnMetadatas(constructor);
Severity: Minor
Found in src/Repository/repositoryDelete.ts - About 3 hrs to fix

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 repositoryDelete has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const repositoryDelete = async (
  instance: BaseEntity
): Promise<boolean> => {
  const { constructor } = getConstructorDatastoreCache(instance);
  const columnMetadatas = getColumnMetadatas(constructor);
Severity: Major
Found in src/Repository/repositoryDelete.ts - About 2 hrs to fix

    Function repositorySave has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

    export const repositorySave = async (
      instance: BaseEntity,
      {
        skipRelationshipMetadatas,
      }: { skipRelationshipMetadatas: RelationshipMetadata[] } = {
    Severity: Minor
    Found in src/Repository/repositorySave.ts - About 2 hrs to fix

    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 toManySet has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    export const toManySet = async (
      instance: BaseEntity,
      toManyRelationshipMetadata: ToManyRelationshipMetadata,
      values: BaseEntity[],
      { skipBackRef }: { skipBackRef: boolean } = { skipBackRef: false }
    Severity: Minor
    Found in src/Relationship/toManySet.ts - About 1 hr to fix

    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 keysFromSearch has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    export async function* keysFromSearch(
      datastore: Datastore,
      options: SearchOptions
    ): AsyncGenerator<Key> {
      let cursor;
    Severity: Minor
    Found in src/utils/datastore.ts - About 25 mins to fix

    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

    Severity
    Category
    Status
    Source
    Language