Showing 124 of 298 total issues
File index.test.ts
has 1864 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import type {
BaseTransaction,
BasicTransaction,
CategorisableTransaction,
PayeeCashTransaction,
File edit.test.ts
has 1505 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import type {
BasicTransaction,
PayeeCashTransaction,
PayeeTransactionType,
SecurityHoldingTransaction,
File edit.test.ts
has 1458 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 783 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 699 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 690 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 475 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import type {
DirectiveTestScope,
JQueryKeyEventObjectMock,
} from "~/mocks/types";
import type {
Function constructor
has 174 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public constructor(
$window: angular.IWindowService,
$timeout: angular.ITimeoutService,
ogModalErrorService: OgModalErrorService,
) {
Function constructor
has 173 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public constructor(
$window: angular.IWindowService,
ogTableNavigableService: OgTableNavigableService,
) {
const directive: angular.IDirective = {
File index.test.ts
has 453 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import type {
ControllerTestFactory,
JQueryMouseEventObjectMock,
} from "~/mocks/types";
import type {
Function link
has 164 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 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 og-table-navigable.test.ts
has 424 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import type {
JQueryKeyEventObjectMock,
JQueryMouseEventObjectMock,
} from "~/mocks/types";
import type {
Method list
has 142 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.connection.execute <<-QUERY
SELECT accounts.id,
accounts.name,
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;