robotty/dank-twitch-irc

View on GitHub

Showing 169 of 169 total issues

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

    clientError: new Promise<void>((resolve, reject) => {
      fakeConn.once("error", (e) => reject(e));
      fakeConn.once("close", () => resolve());
    }),
Severity: Major
Found in lib/helpers.spec.ts and 1 other location - About 1 hr to fix
lib/helpers.spec.ts on lines 234..237

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

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

  public constructor(ircMessage: IRCMessage) {
    super(ircMessage);

    const { isAction, message } = parseActionAndMessage(
      requireParameter(this, 1)
Severity: Minor
Found in lib/message/twitch-types/privmsg.ts - About 1 hr to fix

    Function parseEmotes has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function parseEmotes(
      messageText: string,
      emotesSrc: string
    ): TwitchEmoteList {
      const emotes: TwitchEmoteList = [];
    Severity: Minor
    Found in lib/message/parser/emotes.ts - About 1 hr to fix

      Function joinAll has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export async function joinAll(
        conn: SingleConnection,
        channelNames: string[]
      ): Promise<Record<string, Error | undefined>> {
        // e.g. "JOIN #firstchannel,#secondchannel,#thirdchannel"
      Severity: Minor
      Found in lib/operations/join-all.ts - About 1 hr to fix

        Function assertLink has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function assertLink(e: Error, chain: any[], depth = 0): void {
          const [errorType, message, ...newChain] = chain;
        
          const actualPrototype = Object.getPrototypeOf(e);
          const expectedPrototype = errorType.prototype;
        Severity: Minor
        Found in lib/helpers.spec.ts - About 1 hr to fix

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

              it("should sort results by start index", function () {
                assert.deepStrictEqual(
                  parseEmotes("Kappa Keepo Kappa", "25:0-4,12-16/1902:6-10"),
                  [
                    new TwitchEmote("25", 0, 5, "Kappa"),
          Severity: Major
          Found in lib/message/parser/emotes.spec.ts and 1 other location - About 1 hr to fix
          lib/message/parser/emotes.spec.ts on lines 105..117

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

          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 3 locations. Consider refactoring.
          Open

          export class ChannelIRCMessage extends IRCMessage {
            public readonly channelName: string;
          
            public constructor(message: IRCMessageData) {
              super(message);
          Severity: Major
          Found in lib/message/irc/channel-irc-message.ts and 2 other locations - About 1 hr to fix
          lib/message/twitch-types/membership/join.ts on lines 4..11
          lib/message/twitch-types/membership/part.ts on lines 4..11

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

          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 3 locations. Consider refactoring.
          Open

          export class PartMessage extends ChannelIRCMessage {
            public readonly partedUsername: string;
          
            public constructor(message: IRCMessageData) {
              super(message);
          Severity: Major
          Found in lib/message/twitch-types/membership/part.ts and 2 other locations - About 1 hr to fix
          lib/message/irc/channel-irc-message.ts on lines 30..37
          lib/message/twitch-types/membership/join.ts on lines 4..11

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

          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

              it("should parse multiple emotes in the same message when multiple emojis exist between them", function () {
                assert.deepStrictEqual(
                  parseEmotes(
                    "🌚 Kappa 🌚 🐈 Keepo 🐈 🎨 KappaRoss 🎨",
                    "25:2-6/1902:12-16/70433:22-30"
          Severity: Major
          Found in lib/message/parser/emotes.spec.ts and 1 other location - About 1 hr to fix
          lib/message/parser/emotes.spec.ts on lines 33..42

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

          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 3 locations. Consider refactoring.
          Open

          export class JoinMessage extends ChannelIRCMessage {
            public readonly joinedUsername: string;
          
            public constructor(message: IRCMessageData) {
              super(message);
          Severity: Major
          Found in lib/message/twitch-types/membership/join.ts and 2 other locations - About 1 hr to fix
          lib/message/irc/channel-irc-message.ts on lines 30..37
          lib/message/twitch-types/membership/part.ts on lines 4..11

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

          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

              it("trims spaces at the end of display names", function () {
                const msg = parseTwitchMessage(
                  "@badge-info=;badges=;color=#FF0000;" +
                    "display-name=zwb3_pyramids\\s;emote-sets=0;mod=0;subscriber=0;user-type=" +
                    " :tmi.twitch.tv USERSTATE #randers"
          Severity: Minor
          Found in lib/message/twitch-types/userstate.spec.ts and 1 other location - About 55 mins to fix
          lib/message/twitch-types/whisper.spec.ts on lines 45..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 54.

          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

              it("trims spaces at the end of display names", function () {
                const msg = parseTwitchMessage(
                  "@badges=;color=#2E8B57;display-name=pajbot\\s;emotes=25:7-11;message-id=" +
                    "2034;thread-id=40286300_82008718;turbo=0;user-id=82008718;user-type= " +
                    ":pajbot!pajbot@pajbot.tmi.twitch.tv WHISPER randers :Riftey Kappa"
          Severity: Minor
          Found in lib/message/twitch-types/whisper.spec.ts and 1 other location - About 55 mins to fix
          lib/message/twitch-types/userstate.spec.ts on lines 63..71

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

          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 msg = parseTwitchMessage(
                  "@badge-info=subscriber/15;badges=subscriber/12;color=#00CCBE" +
                    ";display-name=5weatyNuts;emotes=1076725:0-10;flags=;id=fda4d92" +
                    "4-cde3-421d-8eea-713401194446;login=5weatynuts;mod=0;msg-id=resu" +
                    "b;msg-param-cumulative-months=15;msg-param-months=0;msg-param-sh" +
          Severity: Minor
          Found in lib/message/twitch-types/usernotice.spec.ts and 1 other location - About 55 mins to fix
          lib/message/twitch-types/usernotice.spec.ts on lines 172..183

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

          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 msg = parseTwitchMessage(
                  "@badge-info=subscriber/15;badges=subscriber/12;color=#00CCBE" +
                    ";display-name=5weatyNuts;emotes=1076725:0-10;flags=;id=fda4d92" +
                    "4-cde3-421d-8eea-713401194446;login=5weatynutss;mod=0;msg-id=resu" +
                    "b;msg-param-cumulative-months=15;msg-param-months=0;msg-param-sh" +
          Severity: Minor
          Found in lib/message/twitch-types/usernotice.spec.ts and 1 other location - About 55 mins to fix
          lib/message/twitch-types/usernotice.spec.ts on lines 149..160

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

          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 4 locations. Consider refactoring.
          Open

              it("should parse single flag, with one P category", function () {
                assert.deepStrictEqual(parseFlags("stfu", "0-3:P.6"), [
                  new TwitchFlag(0, 4, "stfu", [{ category: "P", score: 6 }]),
                ]);
              });
          Severity: Major
          Found in lib/message/parser/flags.spec.ts and 3 other locations - About 50 mins to fix
          lib/message/parser/flags.spec.ts on lines 11..15
          lib/message/parser/flags.spec.ts on lines 17..21
          lib/message/parser/flags.spec.ts on lines 23..27

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

          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 4 locations. Consider refactoring.
          Open

              it("should parse single flag, with one I category", function () {
                assert.deepStrictEqual(parseFlags("retard streamer", "0-5:I.3"), [
                  new TwitchFlag(0, 6, "retard", [{ category: "I", score: 3 }]),
                ]);
              });
          Severity: Major
          Found in lib/message/parser/flags.spec.ts and 3 other locations - About 50 mins to fix
          lib/message/parser/flags.spec.ts on lines 17..21
          lib/message/parser/flags.spec.ts on lines 23..27
          lib/message/parser/flags.spec.ts on lines 29..33

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

          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 4 locations. Consider refactoring.
          Open

              it("should parse single flag, with one A category", function () {
                assert.deepStrictEqual(parseFlags("you kill", "4-7:A.7"), [
                  new TwitchFlag(4, 8, "kill", [{ category: "A", score: 7 }]),
                ]);
              });
          Severity: Major
          Found in lib/message/parser/flags.spec.ts and 3 other locations - About 50 mins to fix
          lib/message/parser/flags.spec.ts on lines 11..15
          lib/message/parser/flags.spec.ts on lines 17..21
          lib/message/parser/flags.spec.ts on lines 29..33

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

          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 4 locations. Consider refactoring.
          Open

              it("should parse single flag, with one S category", function () {
                assert.deepStrictEqual(parseFlags("a phallic object", "2-8:S.7"), [
                  new TwitchFlag(2, 9, "phallic", [{ category: "S", score: 7 }]),
                ]);
              });
          Severity: Major
          Found in lib/message/parser/flags.spec.ts and 3 other locations - About 50 mins to fix
          lib/message/parser/flags.spec.ts on lines 11..15
          lib/message/parser/flags.spec.ts on lines 23..27
          lib/message/parser/flags.spec.ts on lines 29..33

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

          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 2 locations. Consider refactoring.
          Open

            function checkThrowsUnparseableInt<V, A extends any[]>(
              subject: (
                tagParser: TagValueParser
              ) => (key: string, ...converterArgs: A) => V | undefined,
              ...converterArgs: A
          Severity: Minor
          Found in lib/message/parser/tag-values.spec.ts and 1 other location - About 50 mins to fix
          lib/message/parser/tag-values.spec.ts on lines 36..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 51.

          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 2 locations. Consider refactoring.
          Open

              failure: (msg) =>
                msg instanceof NoticeMessage &&
                msg.channelName === conn.configuration.username &&
                badNoticeIDs.includes(msg.messageID!),
          Severity: Minor
          Found in lib/operations/whisper.ts and 1 other location - About 50 mins to fix
          lib/operations/set-color.ts on lines 30..33

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

          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