scottohara/loot

View on GitHub

Showing 124 of 297 total issues

File index.test.ts has 1832 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import type {
    BaseTransaction,
    BasicTransaction,
    CategorisableTransaction,
    PayeeCashTransaction,
Severity: Major
Found in src/transactions/controllers/index.test.ts - About 5 days to fix

    File edit.test.ts has 1520 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import type {
        BasicTransaction,
        PayeeCashTransaction,
        PayeeTransactionType,
        SecurityHoldingTransaction,
    Severity: Major
    Found in src/transactions/controllers/edit.test.ts - About 4 days to fix

      File edit.test.ts has 1471 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import type { Account, AccountType } from "~/accounts/types";
      import type {
          CategorisableTransaction,
          SecurityTransactionType,
          SplitTransactionChild,
      Severity: Major
      Found in src/schedules/controllers/edit.test.ts - About 3 days to fix

        File states.test.ts has 953 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import type { Account, Accounts } from "~/accounts/types";
        import type {
            StateMock,
            UibModalMock,
        } from "~/mocks/node-modules/angular/types";
        Severity: Major
        Found in src/loot/providers/states.test.ts - About 2 days to fix

          File index.ts has 779 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import "~/transactions/css/index.css";
          import type { Account, AccountType } from "~/accounts/types";
          import type {
              CashTransaction,
              CategorisableTransaction,
          Severity: Major
          Found in src/transactions/controllers/index.ts - About 1 day to fix

            File edit.ts has 701 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import type { Account, StoredAccountType } from "~/accounts/types";
            import type {
                CashTransaction,
                CategorisableTransaction,
                PayeeCashTransaction,
            Severity: Major
            Found in src/transactions/controllers/edit.ts - About 1 day to fix

              File edit.ts has 692 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import type {
                  Account,
                  AccountType,
                  Accounts,
                  StoredAccountType,
              Severity: Major
              Found in src/schedules/controllers/edit.ts - About 1 day to fix

                Function constructor has 301 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public constructor($stateProvider: angular.ui.IStateProvider) {
                        const transactionViews: Record<string, angular.ui.IState> = {
                            "@root": {
                                templateUrl: TransactionIndexView,
                                controller: "TransactionIndexController",
                Severity: Major
                Found in src/loot/providers/states.ts - About 1 day to fix

                  Function constructor has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public constructor(
                          $window: angular.IWindowService,
                          ogTableNavigableService: OgTableNavigableService,
                      ) {
                          const directive: angular.IDirective = {
                  Severity: Minor
                  Found in src/og-components/og-table-navigable/directives/og-table-navigable.ts - About 1 day 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

                  File index.test.ts has 502 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import type {
                      StateMock,
                      UibModalMock,
                      UibModalMockResolves,
                  } from "~/mocks/node-modules/angular/types";
                  Severity: Major
                  Found in src/categories/controllers/index.test.ts - About 1 day to fix

                    File transaction.test.ts has 493 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import type {
                        BasicTransaction,
                        SecurityTransaction,
                        SplitTransaction,
                        SplitTransactionChild,
                    Severity: Minor
                    Found in src/transactions/models/transaction.test.ts - About 7 hrs to fix

                      File og-input-calculator.test.ts has 482 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import type {
                          DirectiveTestScope,
                          JQueryKeyEventObjectMock,
                      } from "~/mocks/types";
                      import type {

                        Function constructor has 184 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public constructor(
                                $window: angular.IWindowService,
                                ogTableNavigableService: OgTableNavigableService,
                            ) {
                                const directive: angular.IDirective = {
                        Severity: Major
                        Found in src/og-components/og-table-navigable/directives/og-table-navigable.ts - About 7 hrs to fix

                          Function link has 175 lines of code (exceeds 25 allowed). Consider refactoring.
                          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)
                          Severity: Major
                          Found in src/og-components/og-table-navigable/directives/og-table-navigable.ts - About 7 hrs to fix

                            Function constructor has 174 lines of code (exceeds 25 allowed). Consider refactoring.
                            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

                              import type {
                                  JQueryKeyEventObjectMock,
                                  JQueryMouseEventObjectMock,
                              } from "~/mocks/types";
                              import type {

                                Function link has 158 lines of code (exceeds 25 allowed). Consider refactoring.
                                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

                                  import type {
                                      ScheduledSplitTransaction,
                                      ScheduledTransaction,
                                  } from "~/schedules/types";
                                  import type {
                                  Severity: Minor
                                  Found in src/schedules/controllers/index.test.ts - About 6 hrs to fix

                                    Method list has 148 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            def list
                                                # Get the current holding balance of all investment accounts
                                                investment_accounts =
                                                    ::ActiveRecord::Base.with_connection do |connection|
                                                        connection.execute <<-QUERY
                                    Severity: Major
                                    Found in app/models/account.rb - About 5 hrs to fix

                                      Function editTransaction has 134 lines of code (exceeds 25 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;
                                      
                                      
                                      Severity: Major
                                      Found in src/transactions/controllers/index.ts - About 5 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language