cityssm/parking-ticket-system

View on GitHub
database/parkingDB/initializeDatabase.ts

Summary

Maintainability
C
1 day
Test Coverage

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

function createParkingTickets(parkingDB: sqlite.Database): void {
  parkingDB
    .prepare(
      `create table if not exists ParkingTickets (
        ticketId integer primary key autoincrement,
Severity: Major
Found in database/parkingDB/initializeDatabase.ts and 1 other location - About 1 hr to fix
database/parkingDB/initializeDatabase.ts on lines 213..239

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 73.

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 2 locations. Consider refactoring.
Open

function createLicencePlateLookupErrorLog(parkingDB: sqlite.Database): void {
  parkingDB
    .prepare(
      `create table if not exists LicencePlateLookupErrorLog (
        batchId integer not null,
Severity: Major
Found in database/parkingDB/initializeDatabase.ts and 1 other location - About 1 hr to fix
database/parkingDB/initializeDatabase.ts on lines 67..102

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 73.

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 5 locations. Consider refactoring.
Open

function createLicencePlateLookupBatches(parkingDB: sqlite.Database): void {
  parkingDB
    .prepare(
      `create table if not exists LicencePlateLookupBatches (
        batchId integer primary key autoincrement,
Severity: Major
Found in database/parkingDB/initializeDatabase.ts and 4 other locations - About 45 mins to fix
database/parkingDB/initializeDatabase.ts on lines 104..118
database/parkingDB/initializeDatabase.ts on lines 120..137
database/parkingDB/initializeDatabase.ts on lines 172..185
database/parkingDB/initializeDatabase.ts on lines 187..211

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 50.

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 5 locations. Consider refactoring.
Open

function createParkingTicketRemarks(parkingDB: sqlite.Database): void {
  parkingDB
    .prepare(
      `create table if not exists ParkingTicketRemarks (
        ticketId integer not null,
Severity: Major
Found in database/parkingDB/initializeDatabase.ts and 4 other locations - About 45 mins to fix
database/parkingDB/initializeDatabase.ts on lines 120..137
database/parkingDB/initializeDatabase.ts on lines 139..152
database/parkingDB/initializeDatabase.ts on lines 172..185
database/parkingDB/initializeDatabase.ts on lines 187..211

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 50.

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 5 locations. Consider refactoring.
Open

function createParkingTicketStatusLog(parkingDB: sqlite.Database): void {
  parkingDB
    .prepare(
      `create table if not exists ParkingTicketStatusLog (
        ticketId integer not null,
Severity: Major
Found in database/parkingDB/initializeDatabase.ts and 4 other locations - About 45 mins to fix
database/parkingDB/initializeDatabase.ts on lines 104..118
database/parkingDB/initializeDatabase.ts on lines 139..152
database/parkingDB/initializeDatabase.ts on lines 172..185
database/parkingDB/initializeDatabase.ts on lines 187..211

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 50.

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 5 locations. Consider refactoring.
Open

function createLicencePlateOwners(parkingDB: sqlite.Database): void {
  parkingDB
    .prepare(
      `create table if not exists LicencePlateOwners (
        licencePlateCountry varchar(2) not null,
Severity: Major
Found in database/parkingDB/initializeDatabase.ts and 4 other locations - About 45 mins to fix
database/parkingDB/initializeDatabase.ts on lines 104..118
database/parkingDB/initializeDatabase.ts on lines 120..137
database/parkingDB/initializeDatabase.ts on lines 139..152
database/parkingDB/initializeDatabase.ts on lines 172..185

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 50.

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 5 locations. Consider refactoring.
Open

function createParkingTicketConvictionBatches(
  parkingDB: sqlite.Database
): void {
  parkingDB
    .prepare(
Severity: Major
Found in database/parkingDB/initializeDatabase.ts and 4 other locations - About 45 mins to fix
database/parkingDB/initializeDatabase.ts on lines 104..118
database/parkingDB/initializeDatabase.ts on lines 120..137
database/parkingDB/initializeDatabase.ts on lines 139..152
database/parkingDB/initializeDatabase.ts on lines 187..211

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 50.

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

function createParkingOffences(parkingDB: sqlite.Database): void {
  parkingDB
    .prepare(
      `create table if not exists ParkingOffences (
        bylawNumber varchar(20) not null,
Severity: Minor
Found in database/parkingDB/initializeDatabase.ts and 2 other locations - About 35 mins to fix
database/parkingDB/initializeDatabase.ts on lines 36..46
database/parkingDB/initializeDatabase.ts on lines 154..170

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 46.

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

function createLicencePlateLookupBatchEntries(
  parkingDB: sqlite.Database
): void {
  parkingDB
    .prepare(
Severity: Minor
Found in database/parkingDB/initializeDatabase.ts and 2 other locations - About 35 mins to fix
database/parkingDB/initializeDatabase.ts on lines 36..46
database/parkingDB/initializeDatabase.ts on lines 48..65

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 46.

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

function createParkingBylaws(parkingDB: sqlite.Database): void {
  parkingDB
    .prepare(
      `create table if not exists ParkingBylaws (
        bylawNumber varchar(20) primary key not null,
Severity: Minor
Found in database/parkingDB/initializeDatabase.ts and 2 other locations - About 35 mins to fix
database/parkingDB/initializeDatabase.ts on lines 48..65
database/parkingDB/initializeDatabase.ts on lines 154..170

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 46.

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

There are no issues that match your filters.

Category
Status