Showing 29 of 29 total issues

Similar blocks of code found in 3 locations. Consider refactoring.
Open

export interface RelationshipOptions {
  key?: Key;
  type: () => EntityConstructor;
  cascade?: boolean;
  backRef: PropertyKey;
Severity: Minor
Found in src/Relationship/relationshipMetadata.ts and 2 other locations - About 30 mins to fix
src/Relationship/ToMany.ts on lines 11..16
src/Relationship/ToOne.ts on lines 14..19

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 45.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

interface ToOneOptions {
  key?: Key;
  type: () => EntityConstructor;
  cascade?: boolean;
  backRef: PropertyKey;
Severity: Minor
Found in src/Relationship/ToOne.ts and 2 other locations - About 30 mins to fix
src/Relationship/ToMany.ts on lines 11..16
src/Relationship/relationshipMetadata.ts on lines 28..33

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 45.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

interface ToManyOptions {
  key?: Key;
  type: () => EntityConstructor;
  cascade?: boolean;
  backRef: PropertyKey;
Severity: Minor
Found in src/Relationship/ToMany.ts and 2 other locations - About 30 mins to fix
src/Relationship/ToOne.ts on lines 14..19
src/Relationship/relationshipMetadata.ts on lines 28..33

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 45.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

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

First header should be a top level header
Open

## Author
Severity: Info
Found in README.md by markdownlint

MD002 - First header should be a top level header

Tags: headers

Aliases: first-header-h1

Parameters: level (number; default 1)

This rule is triggered when the first header in the document isn't a h1 header:

## This isn't a H1 header

### Another header

The first header in the document should be a h1 header:

# Start with a H1 header

## Then use a H2 for subsections

Trailing punctuation in header
Open

## How can I upgrade from the alpha (0.0.X)?
Severity: Info
Found in README.md by markdownlint

MD026 - Trailing punctuation in header

Tags: headers

Aliases: no-trailing-punctuation

Parameters: punctuation (string; default ".,;:!?")

This rule is triggered on any header that has a punctuation character as the last character in the line:

# This is a header.

To fix this, remove any trailing punctuation:

# This is a header

Note: The punctuation parameter can be used to specify what characters class as punctuation at the end of the header. For example, you can set it to '.,;:!' to allow headers with question marks in them, such as might be used in an FAQ.

TODO found
Open

  property?: PropertyKey; // TODO: Clean-up. Separate Relationship, Column and Entity Metadatas properly
Severity: Minor
Found in src/utils/metadata.ts by fixme

TODO found
Open

            // TODO: updatedRelation =
Severity: Minor
Found in src/Repository/repositoryDelete.ts by fixme

TODO found
Open

          // TODO: updatedRelation =
Severity: Minor
Found in src/Repository/repositoryDelete.ts by fixme
Severity
Category
Status
Source
Language