scott-wyatt/trailpack-stripe

View on GitHub

Showing 116 of 254 total issues

Function handleStripeEvent has 440 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  handleStripeEvent(type, stripeObject, cb){
    const models = this.app.models
    const stripeEvents = {

      //Account
Severity: Major
Found in api/services/StripeService.js - About 2 days to fix

    Function schema has 228 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      static schema (app, Sequelize) {
        let schema = {}
        if (app.config.database.orm === 'waterline' || app.config.database.orm === 'js-data') {
          schema = {
            id: {
    Severity: Major
    Found in api/models/Invoice.js - About 1 day to fix

      File StripeService.js has 524 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /* eslint no-console: [0, { allow: ["log","warn", "error"] }] */
      'use strict'
      
      const Service = require('trails/service')
      const _ = require('lodash')
      Severity: Major
      Found in api/services/StripeService.js - About 1 day to fix

        Function schema has 204 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          static schema (app, Sequelize) {
            let schema = {}
            if (app.config.database.orm === 'waterline' || app.config.database.orm === 'js-data') {
              schema = {
                id: {
        Severity: Major
        Found in api/models/Charge.js - About 1 day to fix

          Function schema has 202 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            static schema (app, Sequelize) {
              let schema = {}
              if (app.config.database.orm === 'waterline' || app.config.database.orm === 'js-data') {
                schema = {
                  id: {
          Severity: Major
          Found in api/models/Stripeaccount.js - About 1 day to fix

            Function config has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
            Open

              static config (app) {
                let config = {}
            
                if (app && (app.config.database.orm === 'waterline' || app.config.database.orm === 'js-data')) {
                  config = {
            Severity: Minor
            Found in api/models/Subscription.js - About 7 hrs 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 schema has 180 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              static schema (app, Sequelize) {
                let schema = {}
                if (app.config.database.orm === 'waterline' || app.config.database.orm === 'js-data') {
                  schema = {
                    id: {
            Severity: Major
            Found in api/models/Transfer.js - About 7 hrs to fix

              Function schema has 173 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                static schema (app, Sequelize) {
                  let schema = {}
                  if (app.config.database.orm === 'waterline' || app.config.database.orm === 'js-data') {
                    schema = {
                      id: {
              Severity: Major
              Found in api/models/Bitcoin.js - About 6 hrs to fix

                Function schema has 172 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  static schema (app, Sequelize) {
                    let schema = {}
                    if (app.config.database.orm === 'waterline' || app.config.database.orm === 'js-data') {
                      schema = {
                        id: {
                Severity: Major
                Found in api/models/Card.js - About 6 hrs to fix

                  Function schema has 157 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    static schema (app, Sequelize) {
                      let schema = {}
                      if (app.config.database.orm === 'waterline' || app.config.database.orm === 'js-data') {
                        schema = {
                          id: {
                  Severity: Major
                  Found in api/models/Order.js - About 6 hrs to fix

                    Function schema has 150 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      static schema (app, Sequelize) {
                        let schema = {}
                        if (app.config.database.orm === 'waterline' || app.config.database.orm === 'js-data') {
                          schema = {
                            id: {
                    Severity: Major
                    Found in api/models/Subscription.js - About 6 hrs to fix

                      Function schema has 149 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        static schema (app, Sequelize) {
                          let schema = {}
                          if (app.config.database.orm === 'waterline' || app.config.database.orm === 'js-data') {
                            schema = {
                              id: {
                      Severity: Major
                      Found in api/models/Product.js - About 5 hrs to fix

                        Function schema has 139 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          static schema (app, Sequelize) {
                            let schema = {}
                            if (app.config.database.orm === 'waterline' || app.config.database.orm === 'js-data') {
                              schema = {
                                id: {
                        Severity: Major
                        Found in api/models/Dispute.js - About 5 hrs to fix

                          Function config has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                          Open

                            static config (app) {
                              let config = {}
                          
                              if (app && (app.config.database.orm === 'waterline' || app.config.database.orm === 'js-data')) {
                                config = {
                          Severity: Minor
                          Found in api/models/Invoice.js - About 5 hrs 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 schema has 131 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            static schema (app, Sequelize) {
                              let schema = {}
                              if (app.config.database.orm === 'waterline' || app.config.database.orm === 'js-data') {
                                schema = {
                                  id: {
                          Severity: Major
                          Found in api/models/Recipient.js - About 5 hrs to fix

                            Function schema has 130 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              static schema (app, Sequelize) {
                                let schema = {}
                                if (app.config.database.orm === 'waterline' || app.config.database.orm === 'js-data') {
                                  schema = {
                                    id: {
                            Severity: Major
                            Found in api/models/Applicationfee.js - About 5 hrs to fix

                              Function schema has 130 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                static schema (app, Sequelize) {
                                  let schema = {}
                                  if (app.config.database.orm === 'waterline' || app.config.database.orm === 'js-data') {
                                    schema = {
                                      id: {
                              Severity: Major
                              Found in api/models/Coupon.js - About 5 hrs to fix

                                Function schema has 129 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  static schema (app, Sequelize) {
                                    let schema = {}
                                    if (app.config.database.orm === 'waterline' || app.config.database.orm === 'js-data') {
                                      schema = {
                                        id: {
                                Severity: Major
                                Found in api/models/Customer.js - About 5 hrs to fix

                                  Function schema has 126 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    static schema (app, Sequelize) {
                                      let schema = {}
                                      if (app.config.database.orm === 'waterline' || app.config.database.orm === 'js-data') {
                                        schema = {
                                          id: {
                                  Severity: Major
                                  Found in api/models/Invoiceitem.js - About 5 hrs to fix

                                    Function schema has 124 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      static schema (app, Sequelize) {
                                        let schema = {}
                                        if (app.config.database.orm === 'waterline' || app.config.database.orm === 'js-data') {
                                          schema = {
                                            id: {
                                    Severity: Major
                                    Found in api/models/Sku.js - About 4 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language