cityssm/parking-ticket-system

View on GitHub

Showing 360 of 360 total issues

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

    function clearStatusPanelFunction() {
        const panelBlockElements = statusPanelElement.querySelectorAll('.panel-block');
        for (const panelBlockElement of panelBlockElements) {
            panelBlockElement.remove();
        }
Severity: Minor
Found in public/javascripts/ticket-statuses-edit.js and 1 other location - About 35 mins to fix
public/javascripts/ticket-remarks-edit.js on lines 9..14

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

export function getParkingLocations() {
    if (parkingLocations.length === 0) {
        debug('Cache miss: ParkingLocations');
        parkingLocations = getParkingLocationsFromDatabase();
    }
Severity: Minor
Found in helpers/functions.cache.js and 1 other location - About 35 mins to fix
helpers/functions.cache.js on lines 7..13

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

                if (responseJSON.success) {
                    addBylawCloseModalFunction();
                    if (responseJSON.message !== undefined) {
                        cityssm.alertModal('By-Law Added', responseJSON.message, 'OK', 'warning');
                    }
Severity: Minor
Found in public/javascripts/bylaw-maint.js and 1 other location - About 35 mins to fix
public/javascripts/location-maint.js on lines 149..156

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

  const info = database
    .prepare(
      `update ParkingTickets
        set resolvedDate = ?,
        recordUpdate_userName = ?,
Severity: Major
Found in database/parkingDB/resolveParkingTicket.ts and 3 other locations - About 35 mins to fix
database/parkingDB/lockLookupBatch.ts on lines 16..31
database/parkingDB/markConvictionBatchAsSent.ts on lines 14..30
database/parkingDB/markLookupBatchAsSent.ts on lines 12..28

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

router
    .get('/', (_request, response) => {
    response.render('plate-search', {
        headTitle: 'Licence Plates'
    });
Severity: Minor
Found in routes/plates.js and 1 other location - About 35 mins to fix
routes/tickets.js on lines 37..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 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

Avoid too many return statements within this function.
Open

      return
Severity: Major
Found in public/javascripts/mto-ticketConvict.ts - About 30 mins to fix

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

                onshown(_modalElement, closeModalFunction) {
                    bulmaJS.toggleHtmlClipped();
                    addRemarkCloseModalFunction = closeModalFunction;
                    document.querySelector('#addRemark--remark').focus();
                },
    Severity: Major
    Found in public/javascripts/ticket-remarks-edit.js and 4 other locations - About 30 mins to fix
    public/javascripts/ticket-remarks-edit.js on lines 66..70
    public/javascripts/ticket-statuses-edit.js on lines 148..152
    public/javascripts/ticket-statuses-edit.js on lines 340..344
    public/javascripts/ticket-statuses-edit.js on lines 394..398

    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

    export default function handler(_request, response) {
        const bylaws = getParkingBylawsWithOffenceStats();
        response.render('bylaw-maint', {
            headTitle: 'By-Law Maintenance',
            bylaws
    Severity: Minor
    Found in handlers/admin-get/bylaws.js and 2 other locations - About 30 mins to fix
    handlers/admin-get/cleanup.js on lines 2..8
    handlers/admin-get/locations.js on lines 2..8

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

                onshown(modalElement, closeModalFunction) {
                    bulmaJS.toggleHtmlClipped();
                    editRemarkCloseModalFunction = closeModalFunction;
                    modalElement.querySelector('#editRemark--remark').focus();
                },
    Severity: Major
    Found in public/javascripts/ticket-remarks-edit.js and 4 other locations - About 30 mins to fix
    public/javascripts/ticket-remarks-edit.js on lines 165..169
    public/javascripts/ticket-statuses-edit.js on lines 148..152
    public/javascripts/ticket-statuses-edit.js on lines 340..344
    public/javascripts/ticket-statuses-edit.js on lines 394..398

    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

    Avoid too many return statements within this function.
    Open

                return;
    Severity: Major
    Found in public/javascripts/mto-ticketConvict.js - About 30 mins to fix

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

      export default function handler(_request, response) {
          const locations = getParkingLocations();
          response.render('location-maint', {
              headTitle: 'Parking Location Maintenance',
              locations
      Severity: Minor
      Found in handlers/admin-get/locations.js and 2 other locations - About 30 mins to fix
      handlers/admin-get/bylaws.js on lines 2..8
      handlers/admin-get/cleanup.js on lines 2..8

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

                  onshown(modalElement, closeModalFunction) {
                      bulmaJS.toggleHtmlClipped();
                      addPaidStatusCloseModalFunction = closeModalFunction;
                      modalElement.querySelector('#addPaidStatus--statusField2').focus();
                  },
      Severity: Major
      Found in public/javascripts/ticket-statuses-edit.js and 4 other locations - About 30 mins to fix
      public/javascripts/ticket-remarks-edit.js on lines 66..70
      public/javascripts/ticket-remarks-edit.js on lines 165..169
      public/javascripts/ticket-statuses-edit.js on lines 148..152
      public/javascripts/ticket-statuses-edit.js on lines 340..344

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

                  onshown(modalElement, closeModalFunction) {
                      bulmaJS.toggleHtmlClipped();
                      editStatusCloseModalFunction = closeModalFunction;
                      modalElement.querySelector('#editStatus--statusKey').focus();
                  },
      Severity: Major
      Found in public/javascripts/ticket-statuses-edit.js and 4 other locations - About 30 mins to fix
      public/javascripts/ticket-remarks-edit.js on lines 66..70
      public/javascripts/ticket-remarks-edit.js on lines 165..169
      public/javascripts/ticket-statuses-edit.js on lines 340..344
      public/javascripts/ticket-statuses-edit.js on lines 394..398

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

                  onshown(modalElement, closeModalFunction) {
                      bulmaJS.toggleHtmlClipped();
                      addStatusCloseModalFunction = closeModalFunction;
                      modalElement.querySelector('#addStatus--statusKey').focus();
                  },
      Severity: Major
      Found in public/javascripts/ticket-statuses-edit.js and 4 other locations - About 30 mins to fix
      public/javascripts/ticket-remarks-edit.js on lines 66..70
      public/javascripts/ticket-remarks-edit.js on lines 165..169
      public/javascripts/ticket-statuses-edit.js on lines 148..152
      public/javascripts/ticket-statuses-edit.js on lines 394..398

      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

              (_b = resultsElement.querySelector('table')) === null || _b === void 0 ? void 0 : _b.append(tbodyElement);
      Severity: Minor
      Found in public/javascripts/offence-maint.js and 2 other locations - About 30 mins to fix
      public/javascripts/location-maint.js on lines 125..125
      public/javascripts/plate-search.js on lines 117..117

      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

                  (_a = searchResultsElement.querySelector('.level')) === null || _a === void 0 ? void 0 : _a.append(paginationElement);
      Severity: Minor
      Found in public/javascripts/plate-search.js and 2 other locations - About 30 mins to fix
      public/javascripts/location-maint.js on lines 125..125
      public/javascripts/offence-maint.js on lines 314..314

      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

      export default function handler(_request, response) {
          const counts = getDatabaseCleanupCounts();
          response.render('admin-cleanup', {
              headTitle: 'Database Cleanup',
              counts
      Severity: Minor
      Found in handlers/admin-get/cleanup.js and 2 other locations - About 30 mins to fix
      handlers/admin-get/bylaws.js on lines 2..8
      handlers/admin-get/locations.js on lines 2..8

      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

              (_b = locationResultsElement.querySelector('table')) === null || _b === void 0 ? void 0 : _b.append(tbodyElement);
      Severity: Minor
      Found in public/javascripts/location-maint.js and 2 other locations - About 30 mins to fix
      public/javascripts/offence-maint.js on lines 314..314
      public/javascripts/plate-search.js on lines 117..117

      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 initializeTabs has a Cognitive Complexity of 16 (exceeds 15 allowed). Consider refactoring.
      Open

      pts.initializeTabs = (tabsListElement, callbackFunctions) => {
        if (!tabsListElement) {
          return
        }
      
      
      Severity: Minor
      Found in public/javascripts/main.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