Showing 124 of 297 total issues
Function calculate
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
scope.calculate = (value: string): void => {
// Default the result to the current view value
scope.result = Number(scope.ogInput.formattedToRaw(value));
// Make the current view value available on the scope
Function invalidateCaches
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
private invalidateCaches(transaction: Transaction): void {
this.invalidateCache(this.accountModel, transaction.primary_account);
this.invalidateCache(
this.payeeModel,
(transaction as PayeeCashTransaction).payee as Payee,
Function constructor
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public constructor(numberFilter: angular.IFilterNumber) {
const directive: angular.IDirective = {
restrict: "A",
priority: 1,
require: "ngModel",
Function checkRowMatches
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function checkRowMatches(expectedValues: Schedule | ScheduleEdit): void {
const {
nextDueDate,
isAutoEntered,
primaryAccountName,
Function transitionSuccessHandler
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private transitionSuccessHandler(transactionId: number): void {
if (isNaN(this.focusTransaction(transactionId))) {
// Transaction was not found in the current set
// Get the transaction details from the server
Function constructor
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public constructor(
$scope: angular.IScope,
private readonly $uibModalInstance: angular.ui.bootstrap.IModalInstanceService,
private readonly $q: angular.IQService,
private readonly $timeout: angular.ITimeoutService,
Function keyHandler
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
scope.keyHandler = (event: JQuery.KeyDownEvent): void => {
if (ogTableNavigableService.enabled) {
// Check if the key pressed was a movement key
if (
undefined !==
Function getTransactions
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public getTransactions(
direction: TransactionFetchDirection,
fromDate?: Date,
transactionIdToFocus?: number,
): void {
Function investmentCategorySelected
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public investmentCategorySelected(): void {
let { transaction_type, direction } = this.transaction;
// Check the category selection
if ("object" === typeof this.transaction.category) {
Function investmentCategorySelected
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public investmentCategorySelected(): void {
let { transaction_type, direction } = this.transaction;
// Check the category selection
if ("object" === typeof this.transaction.category) {
Function editCategory
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public editCategory(index?: number): void {
// Helper function to sort by direction, then by category name, then by subcategory name
function byDirectionAndName(a: Category, b: Category): number {
let x: string, y: 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 updateClosingBalance
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private updateClosingBalance(
originalTransaction?: Transaction,
newTransaction?: Transaction,
): void {
// Only proceed if the context has a closing balance (ie. not in search mode)
- 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 editSchedule
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private editSchedule(index?: number): void {
// Helper function to sort by next due date, then by transaction id
function byNextDueDateAndId(
a: ScheduledTransaction,
b: ScheduledTransaction,
- 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 populateFormWith
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export function populateFormWith(schedule: ScheduleEdit): void {
const {
primaryAccountName,
frequency,
rawNextDueDate,
- 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 link
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
link(scope: TransactionFlagScope, iElement: JQuery<Element>): void {
function setTooltip(): void {
scope.tooltip = $sce.trustAsHtml(
scope.transaction.flag_type
? `<strong class="${scope.transaction.flag_type}">${
Method to_ledger_json
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_ledger_json(trx)
{
id: trx['id'],
transaction_type: trx['transaction_type'],
transaction_date: trx['transaction_date'],
Function constructor
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public constructor(
$scope: angular.IScope,
$transitions: angular.ui.IStateParamsService,
private readonly $uibModal: angular.ui.bootstrap.IModalService,
private readonly $timeout: angular.ITimeoutService,
Function constructor
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public constructor(
$scope: angular.IScope,
$transitions: angular.ui.IStateParamsService,
private readonly $uibModal: angular.ui.bootstrap.IModalService,
private readonly $timeout: angular.ITimeoutService,
Function editPayee
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public editPayee(index?: number): void {
// Helper function to sort by payee name
function byName(a: Payee, b: Payee): number {
return a.name.localeCompare(b.name);
}
Function constructor
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public constructor($qMockProvider: QMockProvider) {
const $q: QMock = $qMockProvider.$get(),
success: PromiseMockConfig<{ scope: string }> = {
args: "good-script",
response: { scope: "test scope" },