Showing 19 of 360 total issues
File offence-maint.ts
has 684 lines of code (exceeds 500 allowed). Consider refactoring. Open
Open
/* eslint-disable unicorn/filename-case, unicorn/prefer-module, eslint-comments/disable-enable-pair */
/* eslint-disable @typescript-eslint/indent */
import type { BulmaJS } from '@cityssm/bulma-js/types.js'
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
File mto-ticketConvict.ts
has 626 lines of code (exceeds 500 allowed). Consider refactoring. Open
Open
/* eslint-disable unicorn/filename-case, unicorn/prefer-module, eslint-comments/disable-enable-pair */
/* eslint-disable @typescript-eslint/indent */
/* eslint-disable no-extra-semi */
// eslint-disable-next-line n/no-missing-import
File mto-plateExport.ts
has 590 lines of code (exceeds 500 allowed). Consider refactoring. Open
Open
/* eslint-disable unicorn/filename-case, unicorn/prefer-module, eslint-comments/disable-enable-pair */
/* eslint-disable @typescript-eslint/indent */
/* eslint-disable no-extra-semi */
import type { cityssmGlobal } from '@cityssm/bulma-webapp-js/src/types.js'
File ticket-statuses-edit.ts
has 578 lines of code (exceeds 500 allowed). Consider refactoring. Open
Open
/* eslint-disable unicorn/filename-case, unicorn/prefer-module, eslint-comments/disable-enable-pair */
/* eslint-disable no-extra-semi */
// eslint-disable-next-line n/no-missing-import
import type { BulmaJS } from '@cityssm/bulma-js/types.js'
Function initializeTabs
has a Cognitive Complexity of 35 (exceeds 15 allowed). Consider refactoring. Open
Open
pts.initializeTabs = (tabsListElement, callbackFunctions) => {
var _a;
if (!tabsListElement) {
return;
}
- Read upRead up
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
File offence-maint.js
has 520 lines of code (exceeds 500 allowed). Consider refactoring. Open
Open
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
(() => {
var _a, _b, _c;
const offenceMap = new Map();
File ticket-edit.ts
has 512 lines of code (exceeds 500 allowed). Consider refactoring. Open
Open
/* eslint-disable unicorn/filename-case, eslint-comments/disable-enable-pair */
/* eslint-disable @typescript-eslint/indent */
/* eslint-disable no-labels */
// eslint-disable-next-line n/no-missing-import
File mto-ticketConvict.js
has 505 lines of code (exceeds 500 allowed). Consider refactoring. Open
Open
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
(() => {
var _a, _b;
const canUpdate = ((_a = document.querySelector('main')) === null || _a === void 0 ? void 0 : _a.dataset.canUpdate) === 'true';
Consider simplifying this complex logical expression. Open
Open
if (
(trElement.dataset.isVehicleMakeMatch ?? '') !== '' &&
(trElement.dataset.isLicencePlateExpiryDateMatch ?? '') !== ''
) {
doMatch()
Consider simplifying this complex logical expression. Open
Open
if (
(trElement.dataset.isVehicleMakeMatch ?? '') !== '' ||
(trElement.dataset.isLicencePlateExpiryDateMatch ?? '') !== ''
) {
const ticketVehicle = trElement.dataset.ticketVehicle ?? ''
Consider simplifying this complex logical expression. Open
Open
if (((_a = trElement.dataset.isVehicleMakeMatch) !== null && _a !== void 0 ? _a : '') !== '' ||
((_b = trElement.dataset.isLicencePlateExpiryDateMatch) !== null && _b !== void 0 ? _b : '') !== '') {
const ticketVehicle = (_c = trElement.dataset.ticketVehicle) !== null && _c !== void 0 ? _c : '';
const ticketExpiryDate = (_d = trElement.dataset.ticketExpiryDate) !== null && _d !== void 0 ? _d : '';
const ownerVehicle = (_e = trElement.dataset.ownerVehicle) !== null && _e !== void 0 ? _e : '';
Consider simplifying this complex logical expression. Open
Open
if (((_a = trElement.dataset.isVehicleMakeMatch) !== null && _a !== void 0 ? _a : '') !== '' &&
((_b = trElement.dataset.isLicencePlateExpiryDateMatch) !== null && _b !== void 0 ? _b : '') !== '') {
doMatch();
}
else {
Function createStatus
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function createStatus(batchId, ticketId, statusKey, sessionUser, connectedDatabase) {
Function getLicencePlateOwner
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
licencePlateCountry: string,
licencePlateProvince: string,
licencePlateNumber: string,
recordDateOrBefore: number,
connectedDatabase?: sqlite.Database
Function getLicencePlateOwner
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
export default async function getLicencePlateOwner(licencePlateCountry, licencePlateProvince, licencePlateNumber, recordDateOrBefore, connectedDatabase) {
Function createStatus
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
batchId: number,
ticketId: number,
statusKey: 'convicted' | 'convictionBatch',
sessionUser: PTSUser,
connectedDatabase?: sqlite.Database
Avoid too many return
statements within this function. Open
Open
return
Avoid too many return
statements within this function. Open
Open
return;
Function initializeTabs
has a Cognitive Complexity of 16 (exceeds 15 allowed). Consider refactoring. Open
Open
pts.initializeTabs = (tabsListElement, callbackFunctions) => {
if (!tabsListElement) {
return
}
- Read upRead up
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"