Ikagaka/sakurascript

View on GitHub

Showing 41 of 41 total issues

File sakurascript.ts has 970 lines of code (exceeds 250 allowed). Consider refactoring.
Open

const splitargs = (str: string) =>
  str
    .replace(/"((?:\\\\|\\"|[^"])*)"/g, (_, quoted) => quoted.replace(/,/g, "\0"))
    .split(/\s*,\s*/)
    .map(arg => arg.replace(/\0/g, ",").replace(/\\(.)/, "$1"));
Severity: Major
Found in lib/sakurascript.ts - About 2 days to fix

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

        {
          re: /^\\__q\[((?:\\\\|\\\]|[^\]])+)\]/,
          match: group => {
            const args = splitargs(group[1]);
            if (/^On/.test(args[0])) {
    Severity: Major
    Found in lib/sakurascript.ts and 1 other location - About 4 hrs to fix
    lib/sakurascript.ts on lines 1137..1149

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

    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

        {
          re: /^\\_a\[((?:\\\\|\\\]|[^\]])+)\]/,
          match: group => {
            const args = splitargs(group[1]);
            if (/^On/.test(args[0])) {
    Severity: Major
    Found in lib/sakurascript.ts and 1 other location - About 4 hrs to fix
    lib/sakurascript.ts on lines 1119..1131

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

    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 class UCSChar extends Char {
        constructor(public codePoint: number) {
          super();
        }
    
    
    Severity: Major
    Found in lib/sakurascript.ts and 1 other location - About 2 hrs to fix
    lib/sakurascript.ts on lines 859..871

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

    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 class AsciiChar extends Char {
        constructor(public codePoint: number) {
          super();
        }
    
    
    Severity: Major
    Found in lib/sakurascript.ts and 1 other location - About 2 hrs to fix
    lib/sakurascript.ts on lines 844..856

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

    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 Surface extends SakuraScriptToken {
        constructor(public surface: number, public bracket: boolean) {
          super();
        }
    
    
    Severity: Major
    Found in lib/sakurascript.ts and 2 other locations - About 2 hrs to fix
    lib/sakurascript.ts on lines 168..176
    lib/sakurascript.ts on lines 179..187

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

    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 PlayAnimation extends SakuraScriptToken {
        constructor(public animation: number, public bracket: boolean) {
          super();
        }
    
    
    Severity: Major
    Found in lib/sakurascript.ts and 2 other locations - About 2 hrs to fix
    lib/sakurascript.ts on lines 147..155
    lib/sakurascript.ts on lines 168..176

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

    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 Balloon extends SakuraScriptToken {
        constructor(public balloon: number, public bracket: boolean) {
          super();
        }
    
    
    Severity: Major
    Found in lib/sakurascript.ts and 2 other locations - About 2 hrs to fix
    lib/sakurascript.ts on lines 147..155
    lib/sakurascript.ts on lines 179..187

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

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

      export class Set extends SakuraScriptToken {
        constructor(public id: string, public args: string[]) {
          super();
        }
    
    
    Severity: Major
    Found in lib/sakurascript.ts and 7 other locations - About 2 hrs to fix
    lib/sakurascript.ts on lines 306..314
    lib/sakurascript.ts on lines 339..347
    lib/sakurascript.ts on lines 379..387
    lib/sakurascript.ts on lines 982..990
    lib/sakurascript.ts on lines 1006..1014
    lib/sakurascript.ts on lines 1028..1036
    lib/sakurascript.ts on lines 1039..1047

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

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

      export class BeginEventAnchor extends SakuraScriptToken {
        constructor(public event: string, public references: string[]) {
          super();
        }
    
    
    Severity: Major
    Found in lib/sakurascript.ts and 7 other locations - About 2 hrs to fix
    lib/sakurascript.ts on lines 306..314
    lib/sakurascript.ts on lines 339..347
    lib/sakurascript.ts on lines 982..990
    lib/sakurascript.ts on lines 1006..1014
    lib/sakurascript.ts on lines 1017..1025
    lib/sakurascript.ts on lines 1028..1036
    lib/sakurascript.ts on lines 1039..1047

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

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

      export class Close extends SakuraScriptToken {
        constructor(public command: string, public args: string[]) {
          super();
        }
    
    
    Severity: Major
    Found in lib/sakurascript.ts and 7 other locations - About 2 hrs to fix
    lib/sakurascript.ts on lines 306..314
    lib/sakurascript.ts on lines 339..347
    lib/sakurascript.ts on lines 379..387
    lib/sakurascript.ts on lines 982..990
    lib/sakurascript.ts on lines 1006..1014
    lib/sakurascript.ts on lines 1017..1025
    lib/sakurascript.ts on lines 1028..1036

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

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

      export class ReferencesChoice extends SakuraScriptToken {
        constructor(public text: string, public references: string[]) {
          super();
        }
    
    
    Severity: Major
    Found in lib/sakurascript.ts and 7 other locations - About 2 hrs to fix
    lib/sakurascript.ts on lines 339..347
    lib/sakurascript.ts on lines 379..387
    lib/sakurascript.ts on lines 982..990
    lib/sakurascript.ts on lines 1006..1014
    lib/sakurascript.ts on lines 1017..1025
    lib/sakurascript.ts on lines 1028..1036
    lib/sakurascript.ts on lines 1039..1047

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

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

      export class Raise extends SakuraScriptToken {
        constructor(public event: string, public references: string[]) {
          super();
        }
    
    
    Severity: Major
    Found in lib/sakurascript.ts and 7 other locations - About 2 hrs to fix
    lib/sakurascript.ts on lines 306..314
    lib/sakurascript.ts on lines 339..347
    lib/sakurascript.ts on lines 379..387
    lib/sakurascript.ts on lines 1006..1014
    lib/sakurascript.ts on lines 1017..1025
    lib/sakurascript.ts on lines 1028..1036
    lib/sakurascript.ts on lines 1039..1047

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

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

      export class Notify extends SakuraScriptToken {
        constructor(public event: string, public references: string[]) {
          super();
        }
    
    
    Severity: Major
    Found in lib/sakurascript.ts and 7 other locations - About 2 hrs to fix
    lib/sakurascript.ts on lines 306..314
    lib/sakurascript.ts on lines 339..347
    lib/sakurascript.ts on lines 379..387
    lib/sakurascript.ts on lines 982..990
    lib/sakurascript.ts on lines 1017..1025
    lib/sakurascript.ts on lines 1028..1036
    lib/sakurascript.ts on lines 1039..1047

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

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

      export class BeginEventChoice extends SakuraScriptToken {
        constructor(public event: string, public references: string[]) {
          super();
        }
    
    
    Severity: Major
    Found in lib/sakurascript.ts and 7 other locations - About 2 hrs to fix
    lib/sakurascript.ts on lines 306..314
    lib/sakurascript.ts on lines 379..387
    lib/sakurascript.ts on lines 982..990
    lib/sakurascript.ts on lines 1006..1014
    lib/sakurascript.ts on lines 1017..1025
    lib/sakurascript.ts on lines 1028..1036
    lib/sakurascript.ts on lines 1039..1047

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

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

      export class Open extends SakuraScriptToken {
        constructor(public command: string, public args: string[]) {
          super();
        }
    
    
    Severity: Major
    Found in lib/sakurascript.ts and 7 other locations - About 2 hrs to fix
    lib/sakurascript.ts on lines 306..314
    lib/sakurascript.ts on lines 339..347
    lib/sakurascript.ts on lines 379..387
    lib/sakurascript.ts on lines 982..990
    lib/sakurascript.ts on lines 1006..1014
    lib/sakurascript.ts on lines 1017..1025
    lib/sakurascript.ts on lines 1039..1047

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

    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 class BeginScriptAnchor extends SakuraScriptToken {
        constructor(public script: string) {
          super();
        }
    
    
    Severity: Major
    Found in lib/sakurascript.ts and 1 other location - About 2 hrs to fix
    lib/sakurascript.ts on lines 361..369

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

    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 class BeginScriptChoice extends SakuraScriptToken {
        constructor(public script: string) {
          super();
        }
    
    
    Severity: Major
    Found in lib/sakurascript.ts and 1 other location - About 2 hrs to fix
    lib/sakurascript.ts on lines 401..409

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

    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 BeginReferencesAnchor extends SakuraScriptToken {
        constructor(public references: string[]) {
          super();
        }
    
    
    Severity: Major
    Found in lib/sakurascript.ts and 2 other locations - About 1 hr to fix
    lib/sakurascript.ts on lines 350..358
    lib/sakurascript.ts on lines 529..537

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

    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 BeginReferencesChoice extends SakuraScriptToken {
        constructor(public references: string[]) {
          super();
        }
    
    
    Severity: Major
    Found in lib/sakurascript.ts and 2 other locations - About 1 hr to fix
    lib/sakurascript.ts on lines 390..398
    lib/sakurascript.ts on lines 529..537

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

    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