Showing 297 of 297 total issues
File index.test.ts
has 1832 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import type {
BaseTransaction,
BasicTransaction,
CategorisableTransaction,
PayeeCashTransaction,
File edit.test.ts
has 1520 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import type {
BasicTransaction,
PayeeCashTransaction,
PayeeTransactionType,
SecurityHoldingTransaction,
File edit.test.ts
has 1471 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import type { Account, AccountType } from "~/accounts/types";
import type {
CategorisableTransaction,
SecurityTransactionType,
SplitTransactionChild,
File states.test.ts
has 953 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import type { Account, Accounts } from "~/accounts/types";
import type {
StateMock,
UibModalMock,
} from "~/mocks/node-modules/angular/types";
File index.ts
has 779 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import "~/transactions/css/index.css";
import type { Account, AccountType } from "~/accounts/types";
import type {
CashTransaction,
CategorisableTransaction,
File edit.ts
has 701 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import type { Account, StoredAccountType } from "~/accounts/types";
import type {
CashTransaction,
CategorisableTransaction,
PayeeCashTransaction,
File edit.ts
has 692 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import type {
Account,
AccountType,
Accounts,
StoredAccountType,
Function constructor
has 301 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public constructor($stateProvider: angular.ui.IStateProvider) {
const transactionViews: Record<string, angular.ui.IState> = {
"@root": {
templateUrl: TransactionIndexView,
controller: "TransactionIndexController",
Function constructor
has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring. Open
Open
public constructor(
$window: angular.IWindowService,
ogTableNavigableService: OgTableNavigableService,
) {
const directive: angular.IDirective = {
- 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 index.test.ts
has 502 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import type {
StateMock,
UibModalMock,
UibModalMockResolves,
} from "~/mocks/node-modules/angular/types";
File transaction.test.ts
has 493 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import type {
BasicTransaction,
SecurityTransaction,
SplitTransaction,
SplitTransactionChild,
File og-input-calculator.test.ts
has 482 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import type {
DirectiveTestScope,
JQueryKeyEventObjectMock,
} from "~/mocks/types";
import type {
Function constructor
has 184 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public constructor(
$window: angular.IWindowService,
ogTableNavigableService: OgTableNavigableService,
) {
const directive: angular.IDirective = {
Function link
has 175 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
link(scope: OgTableNavigableScope, iElement: JQuery<Element>): void {
// Helper function to return all TR elements in the table body
scope.getRows = (): JQuery<Element> =>
$window
.$(iElement)
Function constructor
has 174 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public constructor(
$window: angular.IWindowService,
$timeout: angular.ITimeoutService,
ogModalErrorService: OgModalErrorService,
) {
File og-table-navigable.test.ts
has 435 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import type {
JQueryKeyEventObjectMock,
JQueryMouseEventObjectMock,
} from "~/mocks/types";
import type {
Function link
has 158 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
link(
scope: OgInputCalculatorScope,
iElement: JQuery<Element>,
iAttrs: angular.IAttributes,
controllers: angular.IController[],
File index.test.ts
has 422 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import type {
ScheduledSplitTransaction,
ScheduledTransaction,
} from "~/schedules/types";
import type {
Method list
has 148 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def list
# Get the current holding balance of all investment accounts
investment_accounts =
::ActiveRecord::Base.with_connection do |connection|
connection.execute <<-QUERY
Function editTransaction
has 134 lines of code (exceeds 25 allowed). Consider refactoring. Open
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;