Showing 28 of 460 total issues
Function updateLicence
has a Cognitive Complexity of 56 (exceeds 15 allowed). Consider refactoring. Open
export const updateLicence = (requestBody, requestSession) => {
const database = sqlite(databasePath);
const pastLicenceObject = getLicenceWithDB(database, requestBody.licenceID, requestSession, {
includeTicketTypes: true,
includeFields: true,
- 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
Function updateLicence
has a Cognitive Complexity of 56 (exceeds 15 allowed). Consider refactoring. Open
export const updateLicence = (requestBody: LotteryLicenceForm, requestSession: expressSession.Session): boolean => {
// Check if can update
const database = sqlite(databasePath);
- 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
Function organizationReminders
has a Cognitive Complexity of 43 (exceeds 15 allowed). Consider refactoring. Open
llm.organizationReminders = (() => {
const urlPrefix = document.querySelector("main").dataset.urlPrefix;
let reminderCategories: configTypes.ConfigReminderCategory[];
- 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
Function organizationReminders
has a Cognitive Complexity of 43 (exceeds 15 allowed). Consider refactoring. Open
llm.organizationReminders = (() => {
const urlPrefix = document.querySelector("main").dataset.urlPrefix;
let reminderCategories;
const reminderTypeCache = new Map();
let dismissingStatuses = [];
- 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
Function addTicketType_openModal
has a Cognitive Complexity of 42 (exceeds 15 allowed). Consider refactoring. Open
const addTicketType_openModal = (clickEvent) => {
const ticketTypeFieldPresets = {
manufacturerLocationId: lastUsedManufacturerID,
distributorLocationId: lastUsedDistributorID,
ticketType: "",
- 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
Function addTicketType_openModal
has a Cognitive Complexity of 42 (exceeds 15 allowed). Consider refactoring. Open
const addTicketType_openModal = (clickEvent: Event) => {
const ticketTypeFieldPresets = {
manufacturerLocationId: lastUsedManufacturerID,
distributorLocationId: lastUsedDistributorID,
- 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
Function organizationReminders
has 336 lines of code (exceeds 300 allowed). Consider refactoring. Open
llm.organizationReminders = (() => {
const urlPrefix = document.querySelector("main").dataset.urlPrefix;
let reminderCategories: configTypes.ConfigReminderCategory[];
Function handler
has a Cognitive Complexity of 26 (exceeds 15 allowed). Consider refactoring. Open
export const handler = (request, response) => {
const organizationID = Number.parseInt(request.body.organizationID, 10);
const accountNumber = request.body.accountNumber;
const bankingYear = Number.parseInt(request.body.bankingYear, 10);
const bankingMonth = Number.parseInt(request.body.bankingMonth, 10);
- 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
Function getLicences
has a Cognitive Complexity of 26 (exceeds 15 allowed). Consider refactoring. Open
export const getLicences = (requestBodyOrParametersObject: {
externalLicenceNumber?: string;
licenceTypeKey?: string;
organizationID?: string | number;
organizationName?: string;
- 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
Function handler
has a Cognitive Complexity of 26 (exceeds 15 allowed). Consider refactoring. Open
export const handler: RequestHandler = (request, response) => {
const organizationID = Number.parseInt(request.body.organizationID, 10);
const accountNumber = request.body.accountNumber;
const bankingYear = Number.parseInt(request.body.bankingYear, 10);
- 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
Function getLicences
has a Cognitive Complexity of 26 (exceeds 15 allowed). Consider refactoring. Open
export const getLicences = (requestBodyOrParametersObject, requestSession, includeOptions) => {
if (requestBodyOrParametersObject.organizationName && requestBodyOrParametersObject.organizationName !== "") {
includeOptions.includeOrganization = true;
}
const database = sqlite(databasePath, {
- 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
Function rollForwardOrganization
has a Cognitive Complexity of 23 (exceeds 15 allowed). Consider refactoring. Open
export const rollForwardOrganization = (organizationID: number,
updateFiscalYear: boolean,
updateReminders: boolean,
requestSession: expressSession.Session): RollForwardOrganizationReturn => {
- 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
Function rollForwardOrganization
has a Cognitive Complexity of 23 (exceeds 15 allowed). Consider refactoring. Open
export const rollForwardOrganization = (organizationID, updateFiscalYear, updateReminders, requestSession) => {
const rightNowMillis = Date.now();
const database = sqlite(databasePath);
const organizationRow = database.prepare("select fiscalStartDate, fiscalEndDate" +
" from Organizations" +
- 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
Function getLicenceWithDB
has a Cognitive Complexity of 22 (exceeds 15 allowed). Consider refactoring. Open
export const getLicenceWithDB = (database, licenceID, requestSession, queryOptions) => {
const licenceObject = database.prepare("select l.*," +
" lo.locationName, lo.locationAddress1" +
" from LotteryLicences l" +
" left join Locations lo on l.locationID = lo.locationID" +
- 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
Function getLicenceWithDB
has a Cognitive Complexity of 22 (exceeds 15 allowed). Consider refactoring. Open
export const getLicenceWithDB = (database: sqlite.Database, licenceID: number | string,
requestSession: expressSession.Session,
queryOptions: {
includeTicketTypes: boolean;
includeFields: boolean;
- 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
Function initializeTabs
has a Cognitive Complexity of 19 (exceeds 15 allowed). Consider refactoring. Open
llm.initializeTabs = (tabsListElement, callbackFunctions) => {
if (!tabsListElement) {
return;
}
const isPanelOrMenuListTabs = tabsListElement.classList.contains("panel-tabs") || tabsListElement.classList.contains("menu-list");
- 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
Function canUpdateObject
has a Cognitive Complexity of 18 (exceeds 15 allowed). Consider refactoring. Open
export const canUpdateObject = (object, requestSession) => {
const userProperties = requestSession.user.userProperties;
let canUpdate = false;
if (!requestSession) {
canUpdate = false;
- 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
Function canUpdateObject
has a Cognitive Complexity of 18 (exceeds 15 allowed). Consider refactoring. Open
export const canUpdateObject = (object: llm.Record, requestSession: expressSession.Session): boolean => {
const userProperties = requestSession.user.userProperties;
// Check user permissions
- 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
Avoid deeply nested control flow statements. Open
if (activeReminder) {
continue;
}
Avoid deeply nested control flow statements. Open
if (activeReminder) {
continue;
}