cityssm/lottery-licence-manager

View on GitHub

Showing 390 of 460 total issues

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

export const deleteLocation = (locationID: number, requestSession: expressSession.Session): boolean => {

  return runSQL_hasChanges("update Locations" +
    " set recordDelete_userName = ?," +
    " recordDelete_timeMillis = ?" +
Severity: Major
Found in helpers/licencesDB/deleteLocation.ts and 2 other locations - About 2 hrs to fix
helpers/licencesDB/deleteOrganization.ts on lines 6..17
helpers/licencesDB/pokeLicence.ts on lines 6..17

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

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

export const restoreOrganization = (organizationID, requestSession) => {
    const nowMillis = Date.now();
    return runSQL_hasChanges("update Organizations" +
        " set recordDelete_userName = null," +
        " recordDelete_timeMillis = null," +
Severity: Major
Found in helpers/licencesDB/restoreOrganization.js and 1 other location - About 2 hrs to fix
helpers/licencesDB/restoreLocation.js on lines 2..15

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

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

export const restoreLocation = (locationID, requestSession) => {
    const nowMillis = Date.now();
    return runSQL_hasChanges("update Locations" +
        " set recordDelete_userName = null," +
        " recordDelete_timeMillis = null," +
Severity: Major
Found in helpers/licencesDB/restoreLocation.js and 1 other location - About 2 hrs to fix
helpers/licencesDB/restoreOrganization.js on lines 2..15

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

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

      if (rangeType === "year") {

        yearOptgroupElement.classList.remove("is-hidden");
        rangeSelectElement.value = (yearOptgroupElement.children[0] as HTMLOptionElement).value;

Severity: Major
Found in public-typescript/main.ts and 2 other locations - About 1 hr to fix
public-typescript/main.ts on lines 153..162
public-typescript/main.ts on lines 164..173

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

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

      if (rangeType === "quarter") {

        quarterOptgroupElement.classList.remove("is-hidden");
        rangeSelectElement.value = (quarterOptgroupElement.children[0] as HTMLOptionElement).value;

Severity: Major
Found in public-typescript/main.ts and 2 other locations - About 1 hr to fix
public-typescript/main.ts on lines 142..151
public-typescript/main.ts on lines 164..173

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

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

      if (rangeType === "month") {

        monthOptgroupElement.classList.remove("is-hidden");
        rangeSelectElement.value = (monthOptgroupElement.children[0] as HTMLOptionElement).value;

Severity: Major
Found in public-typescript/main.ts and 2 other locations - About 1 hr to fix
public-typescript/main.ts on lines 142..151
public-typescript/main.ts on lines 153..162

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

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

      endDateString = range[0] + "-" +
        ("0" + (endDate.getMonth() + 1).toString()).slice(-2) + "-" +
        endDate.getDate().toString();
Severity: Major
Found in public-typescript/main.ts and 1 other location - About 1 hr to fix
public-typescript/main.ts on lines 86..88

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

      endDateString = range[0] + "-" +
        ("0" + (endDate.getMonth() + 1).toString()).slice(-2) + "-" +
        endDate.getDate().toString();
Severity: Major
Found in public-typescript/main.ts and 1 other location - About 1 hr to fix
public-typescript/main.ts on lines 100..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 2 locations. Consider refactoring.
Open

            endDateString = range[0] + "-" +
                ("0" + (endDate.getMonth() + 1).toString()).slice(-2) + "-" +
                endDate.getDate().toString();
Severity: Major
Found in public-typescript/main.js and 1 other location - About 1 hr to fix
public-typescript/main.js on lines 49..51

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

            endDateString = range[0] + "-" +
                ("0" + (endDate.getMonth() + 1).toString()).slice(-2) + "-" +
                endDate.getDate().toString();
Severity: Major
Found in public-typescript/main.js and 1 other location - About 1 hr to fix
public-typescript/main.js on lines 41..43

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

                if (canCreate) {
                    trElement.insertAdjacentHTML("beforeend", "<td class=\"has-text-right is-hidden-print\">" +
                        (organizationObject.isEligibleForLicences
                            ? "<a class=\"button is-small\" data-tooltip=\"Create a New Licence\"" +
                                " href=\"licences/new/" + organizationObject.organizationID.toString() + "\">" +
Severity: Major
Found in public-typescript/organization-search.js and 1 other location - About 1 hr to fix
public-typescript/organization-search.js on lines 63..73

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

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

          if (canCreate) {

            trElement.insertAdjacentHTML("beforeend", "<td class=\"has-text-right is-hidden-print\">" +
              (organizationObject.isEligibleForLicences
                ? "<a class=\"button is-small\" data-tooltip=\"Create a New Licence\"" +
Severity: Major
Found in public-typescript/organization-search.ts and 1 other location - About 1 hr to fix
public-typescript/organization-search.ts on lines 100..112

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

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

                if (canCreate) {
                    trElement.insertAdjacentHTML("beforeend", "<td class=\"has-text-right is-hidden-print\">" +
                        (organizationObject.canUpdate
                            ? "<a class=\"button is-small\" data-tooltip=\"Edit Organization\"" +
                                " href=\"organizations/" + organizationObject.organizationID.toString() + "/edit\">" +
Severity: Major
Found in public-typescript/organization-search.js and 1 other location - About 1 hr to fix
public-typescript/organization-search.js on lines 88..98

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

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

          if (canCreate) {

            trElement.insertAdjacentHTML("beforeend", "<td class=\"has-text-right is-hidden-print\">" +
              (organizationObject.canUpdate
                ? "<a class=\"button is-small\" data-tooltip=\"Edit Organization\"" +
Severity: Major
Found in public-typescript/organization-search.ts and 1 other location - About 1 hr to fix
public-typescript/organization-search.ts on lines 135..147

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

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

export const getMaxOrganizationReminderIndexWithDB = (database, organizationID) => {
    const result = database.prepare("select reminderIndex" +
        " from OrganizationReminders" +
        " where organizationID = ?" +
        " order by reminderIndex desc" +
Severity: Major
Found in helpers/licencesDB/getMaxOrganizationReminderIndex.js and 5 other locations - About 1 hr to fix
helpers/licencesDB/getMaxLicenceAmendmentIndex.js on lines 1..11
helpers/licencesDB/getMaxLicenceTicketTypeIndex.js on lines 1..11
helpers/licencesDB/getMaxOrganizationBankRecordIndex.js on lines 1..11
helpers/licencesDB/getMaxOrganizationRemarkIndex.js on lines 1..11
helpers/licencesDB/getMaxTransactionIndex.js on lines 1..11

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

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

export const getMaxOrganizationBankRecordIndexWithDB = (database, organizationID) => {
    const result = database.prepare("select recordIndex" +
        " from OrganizationBankRecords" +
        " where organizationID = ?" +
        " order by recordIndex desc" +
Severity: Major
Found in helpers/licencesDB/getMaxOrganizationBankRecordIndex.js and 5 other locations - About 1 hr to fix
helpers/licencesDB/getMaxLicenceAmendmentIndex.js on lines 1..11
helpers/licencesDB/getMaxLicenceTicketTypeIndex.js on lines 1..11
helpers/licencesDB/getMaxOrganizationRemarkIndex.js on lines 1..11
helpers/licencesDB/getMaxOrganizationReminderIndex.js on lines 1..11
helpers/licencesDB/getMaxTransactionIndex.js on lines 1..11

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

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

export const getMaxLicenceTicketTypeIndexWithDB = (database, licenceID) => {
    const result = database.prepare("select ticketTypeIndex" +
        " from LotteryLicenceTicketTypes" +
        " where licenceID = ?" +
        " order by ticketTypeIndex desc" +
Severity: Major
Found in helpers/licencesDB/getMaxLicenceTicketTypeIndex.js and 5 other locations - About 1 hr to fix
helpers/licencesDB/getMaxLicenceAmendmentIndex.js on lines 1..11
helpers/licencesDB/getMaxOrganizationBankRecordIndex.js on lines 1..11
helpers/licencesDB/getMaxOrganizationRemarkIndex.js on lines 1..11
helpers/licencesDB/getMaxOrganizationReminderIndex.js on lines 1..11
helpers/licencesDB/getMaxTransactionIndex.js on lines 1..11

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

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

export const getMaxOrganizationRemarkIndexWithDB = (database, organizationID) => {
    const result = database.prepare("select remarkIndex" +
        " from OrganizationRemarks" +
        " where organizationID = ?" +
        " order by remarkIndex desc" +
Severity: Major
Found in helpers/licencesDB/getMaxOrganizationRemarkIndex.js and 5 other locations - About 1 hr to fix
helpers/licencesDB/getMaxLicenceAmendmentIndex.js on lines 1..11
helpers/licencesDB/getMaxLicenceTicketTypeIndex.js on lines 1..11
helpers/licencesDB/getMaxOrganizationBankRecordIndex.js on lines 1..11
helpers/licencesDB/getMaxOrganizationReminderIndex.js on lines 1..11
helpers/licencesDB/getMaxTransactionIndex.js on lines 1..11

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

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

export const getMaxLicenceAmendmentIndexWithDB = (database, licenceID) => {
    const result = database.prepare("select amendmentIndex" +
        " from LotteryLicenceAmendments" +
        " where licenceID = ?" +
        " order by amendmentIndex desc" +
Severity: Major
Found in helpers/licencesDB/getMaxLicenceAmendmentIndex.js and 5 other locations - About 1 hr to fix
helpers/licencesDB/getMaxLicenceTicketTypeIndex.js on lines 1..11
helpers/licencesDB/getMaxOrganizationBankRecordIndex.js on lines 1..11
helpers/licencesDB/getMaxOrganizationRemarkIndex.js on lines 1..11
helpers/licencesDB/getMaxOrganizationReminderIndex.js on lines 1..11
helpers/licencesDB/getMaxTransactionIndex.js on lines 1..11

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

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

export const getMaxTransactionIndexWithDB = (database, licenceID) => {
    const result = database.prepare("select transactionIndex" +
        " from LotteryLicenceTransactions" +
        " where licenceID = ?" +
        " order by transactionIndex desc" +
Severity: Major
Found in helpers/licencesDB/getMaxTransactionIndex.js and 5 other locations - About 1 hr to fix
helpers/licencesDB/getMaxLicenceAmendmentIndex.js on lines 1..11
helpers/licencesDB/getMaxLicenceTicketTypeIndex.js on lines 1..11
helpers/licencesDB/getMaxOrganizationBankRecordIndex.js on lines 1..11
helpers/licencesDB/getMaxOrganizationRemarkIndex.js on lines 1..11
helpers/licencesDB/getMaxOrganizationReminderIndex.js on lines 1..11

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

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

Severity
Category
Status
Source
Language