fdgt-apis/api

View on GitHub

Showing 29 of 29 total issues

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

export const route = new Route({
    handler: async context => {
        const { command } = context.params

        try {
Severity: Major
Found in src/routes/fdgt/v1/commands/[command].js and 1 other location - About 1 day to fix
src/routes/fdgt/v1/commands/[command]/docs.js on lines 25..53

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 232.

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

export const route = new Route({
    handler: async context => {
        const { command } = context.params

        try {
Severity: Major
Found in src/routes/fdgt/v1/commands/[command]/docs.js and 1 other location - About 1 day to fix
src/routes/fdgt/v1/commands/[command].js on lines 27..55

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 232.

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

export const render = (args = {}) => {
    const {
        channel: channelName,
        connection,
        off,
Severity: Major
Found in src/data-mocks/subsonly.js and 1 other location - About 5 hrs to fix
src/data-mocks/emoteonly.js on lines 36..56

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 142.

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

export const render = (args = {}) => {
    const {
        channel: channelName,
        connection,
        off,
Severity: Major
Found in src/data-mocks/emoteonly.js and 1 other location - About 5 hrs to fix
src/data-mocks/subsonly.js on lines 36..56

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 142.

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

Function handler has 103 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    handler: async context => {
        let sponsors = null
        let sponsorshipTiers = null

        try {
Severity: Major
Found in src/routes/fdgt/v1/sponsors.js - About 4 hrs to fix

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

                                return explainer
                                    .find(item => item.name === `\`${command}\``)
                                    .params
                                    .map(param => ({
                                        description: param.description,
    Severity: Major
    Found in src/routes/fdgt/v1/commands.js and 1 other location - About 2 hrs to fix
    src/routes/fdgt/v1/commands/[command]/params.js on lines 35..39

    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 78.

    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

                const params = explainer.find(item => item.name === `\`${command}\``).params.map(param => ({
                    description: param.description,
                    name: param.name,
                    types: param.type.names,
                }))
    Severity: Major
    Found in src/routes/fdgt/v1/commands/[command]/params.js and 1 other location - About 2 hrs to fix
    src/routes/fdgt/v1/commands.js on lines 42..49

    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 78.

    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

    Function render has 53 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const render = (args = {}) => {
        const {
            channel,
            channelid,
            color,
    Severity: Major
    Found in src/data-mocks/subgift.js - About 2 hrs to fix

      Function render has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const render = (args = {}) => {
          const {
              bitscount,
              color,
              channel,
      Severity: Major
      Found in src/data-mocks/bits.js - About 2 hrs to fix

        Function render has 49 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const render = (args = {}) => {
            const {
                channel,
                channelid,
                color,
        Severity: Minor
        Found in src/data-mocks/resubscription.js - About 1 hr to fix

          Function render has 49 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const render = (args = {}) => {
              const {
                  channel,
                  channelid,
                  color,
          Severity: Minor
          Found in src/data-mocks/subscription.js - About 1 hr to fix

            Function render has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const render = (args = {}) => {
                const {
                    channel,
                    channelid,
                    color,
            Severity: Minor
            Found in src/data-mocks/submysterygift.js - About 1 hr to fix

              Function render has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const render = (args = {}) => {
                  const {
                      channel,
                      channelid,
                      color,
              Severity: Minor
              Found in src/data-mocks/extendsub.js - About 1 hr to fix

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

                    const {
                        channel,
                        channelid,
                        color,
                        count,
                Severity: Major
                Found in src/data-mocks/submysterygift.js and 1 other location - About 1 hr to fix
                src/data-mocks/resubscription.js on lines 46..60

                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 65.

                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

                    const {
                        channel,
                        channelid,
                        color,
                        messageid,
                Severity: Major
                Found in src/data-mocks/resubscription.js and 1 other location - About 1 hr to fix
                src/data-mocks/submysterygift.js on lines 41..55

                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 65.

                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

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

                export const render = (args = {}) => {
                    const {
                        channel,
                        channelid,
                        color,
                Severity: Minor
                Found in src/data-mocks/giftpaidupgrade.js - About 1 hr to fix

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

                  export const render = (args = {}) => {
                      const {
                          channel,
                          channelid,
                          color,
                  Severity: Minor
                  Found in src/data-mocks/raid.js - About 1 hr to fix

                    Function render has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const render = (args = {}) => {
                        const {
                            channel,
                            channelid,
                            color,
                    Severity: Minor
                    Found in src/data-mocks/primepaidupgrade.js - About 1 hr to fix

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

                      const {
                          FIREBASE_AUTH_PROVIDER_X509_CERT_URL,
                          FIREBASE_AUTH_URI,
                          FIREBASE_CLIENT_EMAIL,
                          FIREBASE_CLIENT_ID,
                      Severity: Major
                      Found in src/helpers/firebase.js and 1 other location - About 1 hr to fix
                      src/helpers/getMock.js on lines 27..40

                      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 61.

                      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

                      const mocks = {
                          bits: bitsMock,
                          emoteonly: emoteonlyMock,
                          extendsub: extendsubMock,
                          giftpaidupgrade: giftpaidupgradeMock,
                      Severity: Major
                      Found in src/helpers/getMock.js and 1 other location - About 1 hr to fix
                      src/helpers/firebase.js on lines 11..24

                      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 61.

                      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