Showing 124 of 297 total issues
File edit.cy.ts
has 377 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type {
Transaction,
TransactionEdit,
TransactionsContext,
} from "~/support/transactions/types";
File security.test.ts
has 374 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type {
CacheFactoryMock,
WindowMock,
} from "~/mocks/node-modules/angular/types";
import type {
File index.cy.ts
has 373 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
checkRowMatches,
checkSubtransactionRowValues,
transactionSubtransactionsTableRows,
transactionSubtransactionsToggleButton,
File edit.cy.ts
has 369 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type { Schedule, ScheduleEdit } from "~/support/schedules/types";
import { addDays, lightFormat, startOfDay } from "date-fns";
import {
cancelButton,
invalidateForm,
Function constructor
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
public constructor(
$window: angular.IWindowService,
$timeout: angular.ITimeoutService,
ogModalErrorService: OgModalErrorService,
) {
- 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 payee.test.ts
has 363 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type {
CacheFactoryMock,
WindowMock,
} from "~/mocks/node-modules/angular/types";
import type {
File account.test.ts
has 357 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type { Account, Accounts } from "~/accounts/types";
import type {
CacheFactoryMock,
WindowMock,
} from "~/mocks/node-modules/angular/types";
File index.test.ts
has 338 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type {
StateMock,
UibModalMock,
UibModalMockResolves,
} from "~/mocks/node-modules/angular/types";
Function categorySelected
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
public categorySelected(index?: number): void {
const transaction: SplitTransactionChild | Transaction = isNaN(
Number(index),
)
? this.transaction
Function categorySelected
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
public categorySelected(index?: number): void {
const transaction: SplitTransactionChild | Transaction = isNaN(
Number(index),
)
? this.transaction
File states.ts
has 330 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type { Entity, EntityModel } from "~/loot/types";
import AccountIndexView from "~/accounts/views/index.html";
import type AccountModel from "~/accounts/models/account";
import type { Accounts } from "~/accounts/types";
import AuthenticationEditView from "~/authentication/views/edit.html";
File index.test.ts
has 328 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type {
StateMock,
UibModalMock,
UibModalMockResolves,
} from "~/mocks/node-modules/angular/types";
File category.test.ts
has 324 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type {
CacheFactoryMock,
WindowMock,
} from "~/mocks/node-modules/angular/types";
import type {
Function editTransaction
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
private editTransaction(index?: number): void {
// Helper function to sort by transaction date, then by transaction id
function byTransactionDateAndId(a: Transaction, b: Transaction): number {
let x: Date | number, y: Date | number;
- 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
TransactionIndexController
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
export default class TransactionIndexController {
public readonly tableActions: OgTableActions;
public readonly today: Date = startOfDay(new Date());
Method closing_balance
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
def closing_balance(balance_opts = {})
as_at =
begin
::Date.parse(balance_opts[:as_at]).to_s
rescue ::TypeError, ::ArgumentError
ScheduleEditController
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
export default class ScheduleEditController {
public transaction: ScheduledTransaction;
public mode: "Add Schedule" | "Edit Schedule" | "Enter Transaction";
Function updateInvestmentDetails
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public updateInvestmentDetails(): void {
const QUANTITY_DECIMAL_PLACES = 4,
PRICE_DECIMAL_PLACES = 3,
AMOUNT_DECIMAL_PLACES = 2;
- 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 categorySelected
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public categorySelected(index?: number): void {
const transaction: SplitTransactionChild | Transaction = isNaN(
Number(index),
)
? this.transaction
- 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 categorySelected
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public categorySelected(index?: number): void {
const transaction: SplitTransactionChild | Transaction = isNaN(
Number(index),
)
? this.transaction
- 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"