scottohara/loot

View on GitHub

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,
    Severity: Minor
    Found in src/transactions/models/transaction.ts - About 1 hr to fix

      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",
      Severity: Minor
      Found in src/og-components/og-input-number/directives/og-input-number.ts - About 1 hr to fix

        Function checkRowMatches has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function checkRowMatches(expectedValues: Schedule | ScheduleEdit): void {
            const {
                nextDueDate,
                isAutoEntered,
                primaryAccountName,
        Severity: Minor
        Found in cypress/support/schedules/index.ts - About 1 hr to fix

          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
          Severity: Minor
          Found in src/transactions/controllers/index.ts - About 1 hr to fix

            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,
            Severity: Minor
            Found in src/transactions/controllers/edit.ts - About 1 hr to fix

              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 {
                Severity: Minor
                Found in src/transactions/controllers/index.ts - About 1 hr to fix

                  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) {
                  Severity: Minor
                  Found in src/transactions/controllers/edit.ts - About 1 hr to fix

                    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) {
                    Severity: Minor
                    Found in src/schedules/controllers/edit.ts - About 1 hr to fix

                      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;
                      
                      
                      Severity: Minor
                      Found in src/categories/controllers/index.ts - About 1 hr to fix

                      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)
                      Severity: Minor
                      Found in src/transactions/controllers/index.ts - About 1 hr to fix

                      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,
                      Severity: Minor
                      Found in src/schedules/controllers/index.ts - About 1 hr to fix

                      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,
                      Severity: Minor
                      Found in cypress/support/schedules/edit.ts - About 1 hr to fix

                      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}">${
                      Severity: Minor
                      Found in src/transactions/directives/flag.ts - About 1 hr to fix

                        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'],
                        Severity: Minor
                        Found in app/models/concerns/transactable.rb - About 1 hr to fix

                          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,
                          Severity: Minor
                          Found in src/schedules/controllers/index.ts - About 1 hr to fix

                            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,
                            Severity: Minor
                            Found in src/payees/controllers/index.ts - About 1 hr to fix

                              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);
                                      }
                              Severity: Minor
                              Found in src/payees/controllers/index.ts - About 1 hr to fix

                                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" },
                                Severity: Minor
                                Found in src/mocks/node-modules/angular/services/window.ts - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language