digitalheir/bibtex-js

View on GitHub
src/parser/ts-parser.ts

Summary

Maintainability
F
5 days
Test Coverage

File ts-parser.ts has 587 lines of code (exceeds 250 allowed). Consider refactoring.
Open

function id(x) {
    return x[0];
}

const isNumber = function (x) {
Severity: Major
Found in src/parser/ts-parser.ts - About 1 day to fix

    Function joinTokens has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    function joinTokens(arr) {
        const strs: any = [];
        for (let i = 0; i < arr.length; i++) {
            if (typeof arr[i] === "object") {
                if (!arr[i].string) throw new Error("Expected token to have a string field called 'string' in object " + JSON.stringify(arr[i]));
    Severity: Minor
    Found in src/parser/ts-parser.ts - About 45 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function postprocess has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

                "postprocess": function (data) {
                    if (typeof data[0][0] === "object") {
                        if (!data[0][0].string) throw new Error("Expected " + data[0] + "to have a 'string' field");
                        return data[0][0].string;
                    } else {
    Severity: Minor
    Found in src/parser/ts-parser.ts - About 25 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function postprocess has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

                "postprocess": function (data) {
                    if (typeof data[0][0] === "object") {
                        if (!data[0][0].string) throw new Error("Expected " + data[0] + "to have a 'string' field");
                        return data[0][0].string;
                    } else {
    Severity: Minor
    Found in src/parser/ts-parser.ts - About 25 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

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

            {
                "name": "stringreftoken_n_num",
                "symbols": ["stringreftoken_n_num$subexpression$1"],
                "postprocess": function (data) {
                    if (typeof data[0][0] === "object") {
    Severity: Major
    Found in src/parser/ts-parser.ts and 1 other location - About 6 hrs to fix
    src/parser/ts-parser.ts on lines 468..481

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

    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

            {
                "name": "stringreftoken",
                "symbols": ["stringreftoken$subexpression$1"],
                "postprocess": function (data) {
                    if (typeof data[0][0] === "object") {
    Severity: Major
    Found in src/parser/ts-parser.ts and 1 other location - About 6 hrs to fix
    src/parser/ts-parser.ts on lines 490..503

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

    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

            {
                "name": "braced_string",
                "symbols": [brace_l, "braced_string$ebnf$1", brace_r],
                "postprocess": function (data) {
                    const tkz: any = [];
    Severity: Major
    Found in src/parser/ts-parser.ts and 1 other location - About 2 hrs to fix
    src/parser/ts-parser.ts on lines 353..361

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

            {
                "name": "quoted_string",
                "symbols": [quote_dbl, "quoted_string$ebnf$1", quote_dbl],
                "postprocess": function (data) {
                    const tks: any = [];
    Severity: Major
    Found in src/parser/ts-parser.ts and 1 other location - About 2 hrs to fix
    src/parser/ts-parser.ts on lines 332..341

    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

                    for (let tk = 0; tk < data[0].length; tk++)
                        toeknz.push(data[0][tk][0]);
    Severity: Major
    Found in src/parser/ts-parser.ts and 2 other locations - About 50 mins to fix
    src/parser/ts-parser.ts on lines 417..417
    src/parser/ts-parser.ts on lines 564..564

    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

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

                        for (let i = 0; i < match[1].length; i++) tokenz.push(match[1][i][3]);
    Severity: Major
    Found in src/parser/ts-parser.ts and 2 other locations - About 50 mins to fix
    src/parser/ts-parser.ts on lines 165..166
    src/parser/ts-parser.ts on lines 564..564

    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

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

                for (let Ti = 0; Ti < data[0].length; Ti++) tokens.push(data[0][Ti][0]);
    Severity: Major
    Found in src/parser/ts-parser.ts and 2 other locations - About 50 mins to fix
    src/parser/ts-parser.ts on lines 165..166
    src/parser/ts-parser.ts on lines 417..417

    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

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

            {
                "name": "bib_content$ebnf$1",
                "symbols": ["bib_content$ebnf$1", "bib_content$ebnf$1$subexpression$1"],
                "postprocess": function arrpush(d) {
                    return d[0].concat([d[1]]);
    Severity: Major
    Found in src/parser/ts-parser.ts and 8 other locations - About 40 mins to fix
    src/parser/ts-parser.ts on lines 93..99
    src/parser/ts-parser.ts on lines 153..159
    src/parser/ts-parser.ts on lines 325..331
    src/parser/ts-parser.ts on lines 346..352
    src/parser/ts-parser.ts on lines 378..384
    src/parser/ts-parser.ts on lines 395..401
    src/parser/ts-parser.ts on lines 440..446
    src/parser/ts-parser.ts on lines 553..559

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

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

            {
                "name": "string_ref$subexpression$1$ebnf$1",
                "symbols": ["string_ref$subexpression$1$ebnf$1", "stringreftoken"],
                "postprocess": function arrpush(d) {
                    return d[0].concat([d[1]]);
    Severity: Major
    Found in src/parser/ts-parser.ts and 8 other locations - About 40 mins to fix
    src/parser/ts-parser.ts on lines 93..99
    src/parser/ts-parser.ts on lines 153..159
    src/parser/ts-parser.ts on lines 247..253
    src/parser/ts-parser.ts on lines 325..331
    src/parser/ts-parser.ts on lines 346..352
    src/parser/ts-parser.ts on lines 378..384
    src/parser/ts-parser.ts on lines 395..401
    src/parser/ts-parser.ts on lines 553..559

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

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

            {
                "name": "comment_liberal$ebnf$1",
                "symbols": ["comment_liberal$ebnf$1", "comment_liberal$ebnf$1$subexpression$1"],
                "postprocess": function arrpush(d) {
                    return d[0].concat([d[1]]);
    Severity: Major
    Found in src/parser/ts-parser.ts and 8 other locations - About 40 mins to fix
    src/parser/ts-parser.ts on lines 93..99
    src/parser/ts-parser.ts on lines 247..253
    src/parser/ts-parser.ts on lines 325..331
    src/parser/ts-parser.ts on lines 346..352
    src/parser/ts-parser.ts on lines 378..384
    src/parser/ts-parser.ts on lines 395..401
    src/parser/ts-parser.ts on lines 440..446
    src/parser/ts-parser.ts on lines 553..559

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

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

            {
                "name": "main$ebnf$2",
                "symbols": ["main$ebnf$2", "main$ebnf$2$subexpression$1"],
                "postprocess": function arrpush(d) {
                    return d[0].concat([d[1]]);
    Severity: Major
    Found in src/parser/ts-parser.ts and 8 other locations - About 40 mins to fix
    src/parser/ts-parser.ts on lines 153..159
    src/parser/ts-parser.ts on lines 247..253
    src/parser/ts-parser.ts on lines 325..331
    src/parser/ts-parser.ts on lines 346..352
    src/parser/ts-parser.ts on lines 378..384
    src/parser/ts-parser.ts on lines 395..401
    src/parser/ts-parser.ts on lines 440..446
    src/parser/ts-parser.ts on lines 553..559

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

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

            {
                "name": "key_string$ebnf$1",
                "symbols": ["key_string$ebnf$1", "stringreftoken"],
                "postprocess": function arrpush(d) {
                    return d[0].concat([d[1]]);
    Severity: Major
    Found in src/parser/ts-parser.ts and 8 other locations - About 40 mins to fix
    src/parser/ts-parser.ts on lines 93..99
    src/parser/ts-parser.ts on lines 153..159
    src/parser/ts-parser.ts on lines 247..253
    src/parser/ts-parser.ts on lines 325..331
    src/parser/ts-parser.ts on lines 346..352
    src/parser/ts-parser.ts on lines 395..401
    src/parser/ts-parser.ts on lines 440..446
    src/parser/ts-parser.ts on lines 553..559

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

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

            {
                "name": "value_string$subexpression$1$ebnf$1",
                "symbols": ["value_string$subexpression$1$ebnf$1", "value_string$subexpression$1$ebnf$1$subexpression$1"],
                "postprocess": function arrpush(d) {
                    return d[0].concat([d[1]]);
    Severity: Major
    Found in src/parser/ts-parser.ts and 8 other locations - About 40 mins to fix
    src/parser/ts-parser.ts on lines 93..99
    src/parser/ts-parser.ts on lines 153..159
    src/parser/ts-parser.ts on lines 247..253
    src/parser/ts-parser.ts on lines 325..331
    src/parser/ts-parser.ts on lines 346..352
    src/parser/ts-parser.ts on lines 378..384
    src/parser/ts-parser.ts on lines 440..446
    src/parser/ts-parser.ts on lines 553..559

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

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

            {
                "name": "quoted_string$ebnf$1",
                "symbols": ["quoted_string$ebnf$1", "quoted_string$ebnf$1$subexpression$1"],
                "postprocess": function arrpush(d) {
                    return d[0].concat([d[1]]);
    Severity: Major
    Found in src/parser/ts-parser.ts and 8 other locations - About 40 mins to fix
    src/parser/ts-parser.ts on lines 93..99
    src/parser/ts-parser.ts on lines 153..159
    src/parser/ts-parser.ts on lines 247..253
    src/parser/ts-parser.ts on lines 325..331
    src/parser/ts-parser.ts on lines 378..384
    src/parser/ts-parser.ts on lines 395..401
    src/parser/ts-parser.ts on lines 440..446
    src/parser/ts-parser.ts on lines 553..559

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

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

            {
                "name": "braced_string$ebnf$1",
                "symbols": ["braced_string$ebnf$1", "braced_string$ebnf$1$subexpression$1"],
                "postprocess": function arrpush(d) {
                    return d[0].concat([d[1]]);
    Severity: Major
    Found in src/parser/ts-parser.ts and 8 other locations - About 40 mins to fix
    src/parser/ts-parser.ts on lines 93..99
    src/parser/ts-parser.ts on lines 153..159
    src/parser/ts-parser.ts on lines 247..253
    src/parser/ts-parser.ts on lines 346..352
    src/parser/ts-parser.ts on lines 378..384
    src/parser/ts-parser.ts on lines 395..401
    src/parser/ts-parser.ts on lines 440..446
    src/parser/ts-parser.ts on lines 553..559

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

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

            {
                "name": "non_entry$ebnf$1",
                "symbols": ["non_entry$ebnf$1", "non_entry$ebnf$1$subexpression$2"],
                "postprocess": function arrpush(d) {
                    return d[0].concat([d[1]]);
    Severity: Major
    Found in src/parser/ts-parser.ts and 8 other locations - About 40 mins to fix
    src/parser/ts-parser.ts on lines 93..99
    src/parser/ts-parser.ts on lines 153..159
    src/parser/ts-parser.ts on lines 247..253
    src/parser/ts-parser.ts on lines 325..331
    src/parser/ts-parser.ts on lines 346..352
    src/parser/ts-parser.ts on lines 378..384
    src/parser/ts-parser.ts on lines 395..401
    src/parser/ts-parser.ts on lines 440..446

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

    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

            {
                "name": "string_entry",
                "symbols": [entry_type_string, "_", "entry_body_string"],
                "postprocess": function (data) {
                    return {type: "string", data: data[2]};
    Severity: Minor
    Found in src/parser/ts-parser.ts and 2 other locations - About 30 mins to fix
    src/parser/ts-parser.ts on lines 301..307
    src/parser/ts-parser.ts on lines 308..314

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

    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

            {
                "name": "preamble_entry",
                "symbols": [entry_type_preamble, "_", "entry_body_comment"],
                "postprocess": function (data) {
                    return {type: "preamble", data: data[2]};
    Severity: Minor
    Found in src/parser/ts-parser.ts and 2 other locations - About 30 mins to fix
    src/parser/ts-parser.ts on lines 294..300
    src/parser/ts-parser.ts on lines 308..314

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

    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

            {
                "name": "comment_entry",
                "symbols": [entry_type_comment, "_", "entry_body_comment"],
                "postprocess": function (data) {
                    return {type: "comment", data: data[2]};
    Severity: Minor
    Found in src/parser/ts-parser.ts and 2 other locations - About 30 mins to fix
    src/parser/ts-parser.ts on lines 294..300
    src/parser/ts-parser.ts on lines 301..307

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

    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

    There are no issues that match your filters.

    Category
    Status