scott-wyatt/trailpack-stripe

View on GitHub

Showing 254 of 254 total issues

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

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        if (app.config.database.orm === 'waterline' || app.config.database.orm === 'js-data') {
          schema = {
            id: {
              type: 'string', //"re_3IH1NqUxYmyx2n"
              primaryKey: true,
    Severity: Major
    Found in api/models/Refund.js and 1 other location - About 6 hrs to fix
    api/models/Alipayaccount.js on lines 57..139

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 165.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        if (app.config.database.orm === 'waterline' || app.config.database.orm === 'js-data') {
          schema = {
            id: {
              type: 'string', //"aliacc_16q4o6Bw8aZ7QiYmdCfHA1U9"
              primaryKey: true,
    Severity: Major
    Found in api/models/Alipayaccount.js and 1 other location - About 6 hrs to fix
    api/models/Refund.js on lines 63..177

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 165.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 20 locations. Consider refactoring.
    Open

          if (database.models[this.constructor.name.toLowerCase()]) {
            if (database.stores[database.models[this.constructor.name.toLowerCase()].store].dialect == 'postgres') {
              sJSON = (field) => {
                return {
                  type: Sequelize.JSON
    Severity: Major
    Found in api/models/Subscription.js and 19 other locations - About 6 hrs to fix
    api/models/Applicationfee.js on lines 133..148
    api/models/Applicationfeerefund.js on lines 114..129
    api/models/Bankaccount.js on lines 129..144
    api/models/Bitcoin.js on lines 153..168
    api/models/Card.js on lines 153..168
    api/models/Charge.js on lines 181..196
    api/models/Coupon.js on lines 126..141
    api/models/Customer.js on lines 126..141
    api/models/Discount.js on lines 119..134
    api/models/Event.js on lines 106..121
    api/models/Invoice.js on lines 223..238
    api/models/Invoiceitem.js on lines 140..155
    api/models/Plan.js on lines 123..138
    api/models/Recipient.js on lines 132..147
    api/models/Refund.js on lines 120..135
    api/models/Sku.js on lines 139..154
    api/models/Token.js on lines 108..123
    api/models/Transfer.js on lines 153..168
    api/models/Transferreversal.js on lines 114..129

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 164.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 20 locations. Consider refactoring.
    Open

          if (database.models[this.constructor.name.toLowerCase()]) {
            if (database.stores[database.models[this.constructor.name.toLowerCase()].store].dialect == 'postgres') {
              sJSON = (field) => {
                return {
                  type: Sequelize.JSON
    Severity: Major
    Found in api/models/Refund.js and 19 other locations - About 6 hrs to fix
    api/models/Applicationfee.js on lines 133..148
    api/models/Applicationfeerefund.js on lines 114..129
    api/models/Bankaccount.js on lines 129..144
    api/models/Bitcoin.js on lines 153..168
    api/models/Card.js on lines 153..168
    api/models/Charge.js on lines 181..196
    api/models/Coupon.js on lines 126..141
    api/models/Customer.js on lines 126..141
    api/models/Discount.js on lines 119..134
    api/models/Event.js on lines 106..121
    api/models/Invoice.js on lines 223..238
    api/models/Invoiceitem.js on lines 140..155
    api/models/Plan.js on lines 123..138
    api/models/Recipient.js on lines 132..147
    api/models/Sku.js on lines 139..154
    api/models/Subscription.js on lines 180..195
    api/models/Token.js on lines 108..123
    api/models/Transfer.js on lines 153..168
    api/models/Transferreversal.js on lines 114..129

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 164.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 20 locations. Consider refactoring.
    Open

          if (database.models[this.constructor.name.toLowerCase()]) {
            if (database.stores[database.models[this.constructor.name.toLowerCase()].store].dialect == 'postgres') {
              sJSON = (field) => {
                return {
                  type: Sequelize.JSON
    Severity: Major
    Found in api/models/Card.js and 19 other locations - About 6 hrs to fix
    api/models/Applicationfee.js on lines 133..148
    api/models/Applicationfeerefund.js on lines 114..129
    api/models/Bankaccount.js on lines 129..144
    api/models/Bitcoin.js on lines 153..168
    api/models/Charge.js on lines 181..196
    api/models/Coupon.js on lines 126..141
    api/models/Customer.js on lines 126..141
    api/models/Discount.js on lines 119..134
    api/models/Event.js on lines 106..121
    api/models/Invoice.js on lines 223..238
    api/models/Invoiceitem.js on lines 140..155
    api/models/Plan.js on lines 123..138
    api/models/Recipient.js on lines 132..147
    api/models/Refund.js on lines 120..135
    api/models/Sku.js on lines 139..154
    api/models/Subscription.js on lines 180..195
    api/models/Token.js on lines 108..123
    api/models/Transfer.js on lines 153..168
    api/models/Transferreversal.js on lines 114..129

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 164.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 20 locations. Consider refactoring.
    Open

          if (database.models[this.constructor.name.toLowerCase()]) {
            if (database.stores[database.models[this.constructor.name.toLowerCase()].store].dialect == 'postgres') {
              sJSON = (field) => {
                return {
                  type: Sequelize.JSON
    Severity: Major
    Found in api/models/Coupon.js and 19 other locations - About 6 hrs to fix
    api/models/Applicationfee.js on lines 133..148
    api/models/Applicationfeerefund.js on lines 114..129
    api/models/Bankaccount.js on lines 129..144
    api/models/Bitcoin.js on lines 153..168
    api/models/Card.js on lines 153..168
    api/models/Charge.js on lines 181..196
    api/models/Customer.js on lines 126..141
    api/models/Discount.js on lines 119..134
    api/models/Event.js on lines 106..121
    api/models/Invoice.js on lines 223..238
    api/models/Invoiceitem.js on lines 140..155
    api/models/Plan.js on lines 123..138
    api/models/Recipient.js on lines 132..147
    api/models/Refund.js on lines 120..135
    api/models/Sku.js on lines 139..154
    api/models/Subscription.js on lines 180..195
    api/models/Token.js on lines 108..123
    api/models/Transfer.js on lines 153..168
    api/models/Transferreversal.js on lines 114..129

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 164.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 20 locations. Consider refactoring.
    Open

          if (database.models[this.constructor.name.toLowerCase()]) {
            if (database.stores[database.models[this.constructor.name.toLowerCase()].store].dialect == 'postgres') {
              sJSON = (field) => {
                return {
                  type: Sequelize.JSON
    Severity: Major
    Found in api/models/Applicationfeerefund.js and 19 other locations - About 6 hrs to fix
    api/models/Applicationfee.js on lines 133..148
    api/models/Bankaccount.js on lines 129..144
    api/models/Bitcoin.js on lines 153..168
    api/models/Card.js on lines 153..168
    api/models/Charge.js on lines 181..196
    api/models/Coupon.js on lines 126..141
    api/models/Customer.js on lines 126..141
    api/models/Discount.js on lines 119..134
    api/models/Event.js on lines 106..121
    api/models/Invoice.js on lines 223..238
    api/models/Invoiceitem.js on lines 140..155
    api/models/Plan.js on lines 123..138
    api/models/Recipient.js on lines 132..147
    api/models/Refund.js on lines 120..135
    api/models/Sku.js on lines 139..154
    api/models/Subscription.js on lines 180..195
    api/models/Token.js on lines 108..123
    api/models/Transfer.js on lines 153..168
    api/models/Transferreversal.js on lines 114..129

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 164.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 20 locations. Consider refactoring.
    Open

          if (database.models[this.constructor.name.toLowerCase()]) {
            if (database.stores[database.models[this.constructor.name.toLowerCase()].store].dialect == 'postgres') {
              sJSON = (field) => {
                return {
                  type: Sequelize.JSON
    Severity: Major
    Found in api/models/Token.js and 19 other locations - About 6 hrs to fix
    api/models/Applicationfee.js on lines 133..148
    api/models/Applicationfeerefund.js on lines 114..129
    api/models/Bankaccount.js on lines 129..144
    api/models/Bitcoin.js on lines 153..168
    api/models/Card.js on lines 153..168
    api/models/Charge.js on lines 181..196
    api/models/Coupon.js on lines 126..141
    api/models/Customer.js on lines 126..141
    api/models/Discount.js on lines 119..134
    api/models/Event.js on lines 106..121
    api/models/Invoice.js on lines 223..238
    api/models/Invoiceitem.js on lines 140..155
    api/models/Plan.js on lines 123..138
    api/models/Recipient.js on lines 132..147
    api/models/Refund.js on lines 120..135
    api/models/Sku.js on lines 139..154
    api/models/Subscription.js on lines 180..195
    api/models/Transfer.js on lines 153..168
    api/models/Transferreversal.js on lines 114..129

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 164.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 20 locations. Consider refactoring.
    Open

          if (database.models[this.constructor.name.toLowerCase()]) {
            if (database.stores[database.models[this.constructor.name.toLowerCase()].store].dialect == 'postgres') {
              sJSON = (field) => {
                return {
                  type: Sequelize.JSON
    Severity: Major
    Found in api/models/Bitcoin.js and 19 other locations - About 6 hrs to fix
    api/models/Applicationfee.js on lines 133..148
    api/models/Applicationfeerefund.js on lines 114..129
    api/models/Bankaccount.js on lines 129..144
    api/models/Card.js on lines 153..168
    api/models/Charge.js on lines 181..196
    api/models/Coupon.js on lines 126..141
    api/models/Customer.js on lines 126..141
    api/models/Discount.js on lines 119..134
    api/models/Event.js on lines 106..121
    api/models/Invoice.js on lines 223..238
    api/models/Invoiceitem.js on lines 140..155
    api/models/Plan.js on lines 123..138
    api/models/Recipient.js on lines 132..147
    api/models/Refund.js on lines 120..135
    api/models/Sku.js on lines 139..154
    api/models/Subscription.js on lines 180..195
    api/models/Token.js on lines 108..123
    api/models/Transfer.js on lines 153..168
    api/models/Transferreversal.js on lines 114..129

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 164.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 20 locations. Consider refactoring.
    Open

          if (database.models[this.constructor.name.toLowerCase()]) {
            if (database.stores[database.models[this.constructor.name.toLowerCase()].store].dialect == 'postgres') {
              sJSON = (field) => {
                return {
                  type: Sequelize.JSON
    Severity: Major
    Found in api/models/Customer.js and 19 other locations - About 6 hrs to fix
    api/models/Applicationfee.js on lines 133..148
    api/models/Applicationfeerefund.js on lines 114..129
    api/models/Bankaccount.js on lines 129..144
    api/models/Bitcoin.js on lines 153..168
    api/models/Card.js on lines 153..168
    api/models/Charge.js on lines 181..196
    api/models/Coupon.js on lines 126..141
    api/models/Discount.js on lines 119..134
    api/models/Event.js on lines 106..121
    api/models/Invoice.js on lines 223..238
    api/models/Invoiceitem.js on lines 140..155
    api/models/Plan.js on lines 123..138
    api/models/Recipient.js on lines 132..147
    api/models/Refund.js on lines 120..135
    api/models/Sku.js on lines 139..154
    api/models/Subscription.js on lines 180..195
    api/models/Token.js on lines 108..123
    api/models/Transfer.js on lines 153..168
    api/models/Transferreversal.js on lines 114..129

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 164.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 20 locations. Consider refactoring.
    Open

          if (database.models[this.constructor.name.toLowerCase()]) {
            if (database.stores[database.models[this.constructor.name.toLowerCase()].store].dialect == 'postgres') {
              sJSON = (field) => {
                return {
                  type: Sequelize.JSON
    Severity: Major
    Found in api/models/Recipient.js and 19 other locations - About 6 hrs to fix
    api/models/Applicationfee.js on lines 133..148
    api/models/Applicationfeerefund.js on lines 114..129
    api/models/Bankaccount.js on lines 129..144
    api/models/Bitcoin.js on lines 153..168
    api/models/Card.js on lines 153..168
    api/models/Charge.js on lines 181..196
    api/models/Coupon.js on lines 126..141
    api/models/Customer.js on lines 126..141
    api/models/Discount.js on lines 119..134
    api/models/Event.js on lines 106..121
    api/models/Invoice.js on lines 223..238
    api/models/Invoiceitem.js on lines 140..155
    api/models/Plan.js on lines 123..138
    api/models/Refund.js on lines 120..135
    api/models/Sku.js on lines 139..154
    api/models/Subscription.js on lines 180..195
    api/models/Token.js on lines 108..123
    api/models/Transfer.js on lines 153..168
    api/models/Transferreversal.js on lines 114..129

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 164.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 20 locations. Consider refactoring.
    Open

          if (database.models[this.constructor.name.toLowerCase()]) {
            if (database.stores[database.models[this.constructor.name.toLowerCase()].store].dialect == 'postgres') {
              sJSON = (field) => {
                return {
                  type: Sequelize.JSON
    Severity: Major
    Found in api/models/Plan.js and 19 other locations - About 6 hrs to fix
    api/models/Applicationfee.js on lines 133..148
    api/models/Applicationfeerefund.js on lines 114..129
    api/models/Bankaccount.js on lines 129..144
    api/models/Bitcoin.js on lines 153..168
    api/models/Card.js on lines 153..168
    api/models/Charge.js on lines 181..196
    api/models/Coupon.js on lines 126..141
    api/models/Customer.js on lines 126..141
    api/models/Discount.js on lines 119..134
    api/models/Event.js on lines 106..121
    api/models/Invoice.js on lines 223..238
    api/models/Invoiceitem.js on lines 140..155
    api/models/Recipient.js on lines 132..147
    api/models/Refund.js on lines 120..135
    api/models/Sku.js on lines 139..154
    api/models/Subscription.js on lines 180..195
    api/models/Token.js on lines 108..123
    api/models/Transfer.js on lines 153..168
    api/models/Transferreversal.js on lines 114..129

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 164.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 20 locations. Consider refactoring.
    Open

          if (database.models[this.constructor.name.toLowerCase()]) {
            if (database.stores[database.models[this.constructor.name.toLowerCase()].store].dialect == 'postgres') {
              sJSON = (field) => {
                return {
                  type: Sequelize.JSON
    Severity: Major
    Found in api/models/Transfer.js and 19 other locations - About 6 hrs to fix
    api/models/Applicationfee.js on lines 133..148
    api/models/Applicationfeerefund.js on lines 114..129
    api/models/Bankaccount.js on lines 129..144
    api/models/Bitcoin.js on lines 153..168
    api/models/Card.js on lines 153..168
    api/models/Charge.js on lines 181..196
    api/models/Coupon.js on lines 126..141
    api/models/Customer.js on lines 126..141
    api/models/Discount.js on lines 119..134
    api/models/Event.js on lines 106..121
    api/models/Invoice.js on lines 223..238
    api/models/Invoiceitem.js on lines 140..155
    api/models/Plan.js on lines 123..138
    api/models/Recipient.js on lines 132..147
    api/models/Refund.js on lines 120..135
    api/models/Sku.js on lines 139..154
    api/models/Subscription.js on lines 180..195
    api/models/Token.js on lines 108..123
    api/models/Transferreversal.js on lines 114..129

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 164.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 20 locations. Consider refactoring.
    Open

          if (database.models[this.constructor.name.toLowerCase()]) {
            if (database.stores[database.models[this.constructor.name.toLowerCase()].store].dialect == 'postgres') {
              sJSON = (field) => {
                return {
                  type: Sequelize.JSON
    Severity: Major
    Found in api/models/Charge.js and 19 other locations - About 6 hrs to fix
    api/models/Applicationfee.js on lines 133..148
    api/models/Applicationfeerefund.js on lines 114..129
    api/models/Bankaccount.js on lines 129..144
    api/models/Bitcoin.js on lines 153..168
    api/models/Card.js on lines 153..168
    api/models/Coupon.js on lines 126..141
    api/models/Customer.js on lines 126..141
    api/models/Discount.js on lines 119..134
    api/models/Event.js on lines 106..121
    api/models/Invoice.js on lines 223..238
    api/models/Invoiceitem.js on lines 140..155
    api/models/Plan.js on lines 123..138
    api/models/Recipient.js on lines 132..147
    api/models/Refund.js on lines 120..135
    api/models/Sku.js on lines 139..154
    api/models/Subscription.js on lines 180..195
    api/models/Token.js on lines 108..123
    api/models/Transfer.js on lines 153..168
    api/models/Transferreversal.js on lines 114..129

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 164.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 20 locations. Consider refactoring.
    Open

          if (database.models[this.constructor.name.toLowerCase()]) {
            if (database.stores[database.models[this.constructor.name.toLowerCase()].store].dialect == 'postgres') {
              sJSON = (field) => {
                return {
                  type: Sequelize.JSON
    Severity: Major
    Found in api/models/Invoice.js and 19 other locations - About 6 hrs to fix
    api/models/Applicationfee.js on lines 133..148
    api/models/Applicationfeerefund.js on lines 114..129
    api/models/Bankaccount.js on lines 129..144
    api/models/Bitcoin.js on lines 153..168
    api/models/Card.js on lines 153..168
    api/models/Charge.js on lines 181..196
    api/models/Coupon.js on lines 126..141
    api/models/Customer.js on lines 126..141
    api/models/Discount.js on lines 119..134
    api/models/Event.js on lines 106..121
    api/models/Invoiceitem.js on lines 140..155
    api/models/Plan.js on lines 123..138
    api/models/Recipient.js on lines 132..147
    api/models/Refund.js on lines 120..135
    api/models/Sku.js on lines 139..154
    api/models/Subscription.js on lines 180..195
    api/models/Token.js on lines 108..123
    api/models/Transfer.js on lines 153..168
    api/models/Transferreversal.js on lines 114..129

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 164.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 20 locations. Consider refactoring.
    Open

          if (database.models[this.constructor.name.toLowerCase()]) {
            if (database.stores[database.models[this.constructor.name.toLowerCase()].store].dialect == 'postgres') {
              sJSON = (field) => {
                return {
                  type: Sequelize.JSON
    Severity: Major
    Found in api/models/Transferreversal.js and 19 other locations - About 6 hrs to fix
    api/models/Applicationfee.js on lines 133..148
    api/models/Applicationfeerefund.js on lines 114..129
    api/models/Bankaccount.js on lines 129..144
    api/models/Bitcoin.js on lines 153..168
    api/models/Card.js on lines 153..168
    api/models/Charge.js on lines 181..196
    api/models/Coupon.js on lines 126..141
    api/models/Customer.js on lines 126..141
    api/models/Discount.js on lines 119..134
    api/models/Event.js on lines 106..121
    api/models/Invoice.js on lines 223..238
    api/models/Invoiceitem.js on lines 140..155
    api/models/Plan.js on lines 123..138
    api/models/Recipient.js on lines 132..147
    api/models/Refund.js on lines 120..135
    api/models/Sku.js on lines 139..154
    api/models/Subscription.js on lines 180..195
    api/models/Token.js on lines 108..123
    api/models/Transfer.js on lines 153..168

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 164.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 20 locations. Consider refactoring.
    Open

          if (database.models[this.constructor.name.toLowerCase()]) {
            if (database.stores[database.models[this.constructor.name.toLowerCase()].store].dialect == 'postgres') {
              sJSON = (field) => {
                return {
                  type: Sequelize.JSON
    Severity: Major
    Found in api/models/Event.js and 19 other locations - About 6 hrs to fix
    api/models/Applicationfee.js on lines 133..148
    api/models/Applicationfeerefund.js on lines 114..129
    api/models/Bankaccount.js on lines 129..144
    api/models/Bitcoin.js on lines 153..168
    api/models/Card.js on lines 153..168
    api/models/Charge.js on lines 181..196
    api/models/Coupon.js on lines 126..141
    api/models/Customer.js on lines 126..141
    api/models/Discount.js on lines 119..134
    api/models/Invoice.js on lines 223..238
    api/models/Invoiceitem.js on lines 140..155
    api/models/Plan.js on lines 123..138
    api/models/Recipient.js on lines 132..147
    api/models/Refund.js on lines 120..135
    api/models/Sku.js on lines 139..154
    api/models/Subscription.js on lines 180..195
    api/models/Token.js on lines 108..123
    api/models/Transfer.js on lines 153..168
    api/models/Transferreversal.js on lines 114..129

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 164.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 20 locations. Consider refactoring.
    Open

          if (database.models[this.constructor.name.toLowerCase()]) {
            if (database.stores[database.models[this.constructor.name.toLowerCase()].store].dialect == 'postgres') {
              sJSON = (field) => {
                return {
                  type: Sequelize.JSON
    Severity: Major
    Found in api/models/Bankaccount.js and 19 other locations - About 6 hrs to fix
    api/models/Applicationfee.js on lines 133..148
    api/models/Applicationfeerefund.js on lines 114..129
    api/models/Bitcoin.js on lines 153..168
    api/models/Card.js on lines 153..168
    api/models/Charge.js on lines 181..196
    api/models/Coupon.js on lines 126..141
    api/models/Customer.js on lines 126..141
    api/models/Discount.js on lines 119..134
    api/models/Event.js on lines 106..121
    api/models/Invoice.js on lines 223..238
    api/models/Invoiceitem.js on lines 140..155
    api/models/Plan.js on lines 123..138
    api/models/Recipient.js on lines 132..147
    api/models/Refund.js on lines 120..135
    api/models/Sku.js on lines 139..154
    api/models/Subscription.js on lines 180..195
    api/models/Token.js on lines 108..123
    api/models/Transfer.js on lines 153..168
    api/models/Transferreversal.js on lines 114..129

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 164.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 20 locations. Consider refactoring.
    Open

          if (database.models[this.constructor.name.toLowerCase()]) {
            if (database.stores[database.models[this.constructor.name.toLowerCase()].store].dialect == 'postgres') {
              sJSON = (field) => {
                return {
                  type: Sequelize.JSON
    Severity: Major
    Found in api/models/Discount.js and 19 other locations - About 6 hrs to fix
    api/models/Applicationfee.js on lines 133..148
    api/models/Applicationfeerefund.js on lines 114..129
    api/models/Bankaccount.js on lines 129..144
    api/models/Bitcoin.js on lines 153..168
    api/models/Card.js on lines 153..168
    api/models/Charge.js on lines 181..196
    api/models/Coupon.js on lines 126..141
    api/models/Customer.js on lines 126..141
    api/models/Event.js on lines 106..121
    api/models/Invoice.js on lines 223..238
    api/models/Invoiceitem.js on lines 140..155
    api/models/Plan.js on lines 123..138
    api/models/Recipient.js on lines 132..147
    api/models/Refund.js on lines 120..135
    api/models/Sku.js on lines 139..154
    api/models/Subscription.js on lines 180..195
    api/models/Token.js on lines 108..123
    api/models/Transfer.js on lines 153..168
    api/models/Transferreversal.js on lines 114..129

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 164.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Severity
    Category
    Status
    Source
    Language