zk/src/main/resources/web/js/zk/dateImpl.ts

Summary

Maintainability
D
1 day
Test Coverage

DateImpl has 49 functions (exceeds 20 allowed). Consider refactoring.
Open

    export class DateImpl {
        /** @internal */
        _moment: Moment;
        /** @internal */
        _timezone: string;
Severity: Minor
Found in zk/src/main/resources/web/js/zk/dateImpl.ts - About 6 hrs to fix

    Function newInstance has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

            newInstance(param?: number | DateImpl | Parameters<DateConstructor['UTC']>, tz?: string): DateImpl {
                let m: Moment;
                if (tz)
                    tz = parseTzId(tz);
                else
    Severity: Minor
    Found in zk/src/main/resources/web/js/zk/dateImpl.ts - About 35 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 setHours has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

            setHours(hr: number, min?: number, sec?: number, msec?: number): number {
                var mt = this._getTzMoment();
                mt.hour(hr);
                if (min != null) {
                    mt.minute(min);
    Severity: Minor
    Found in zk/src/main/resources/web/js/zk/dateImpl.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 12 locations. Consider refactoring.
    Open

            setMinutes(minutes: number): number {
                return this._getTzMoment().minute(minutes).valueOf();
            }
    Severity: Major
    Found in zk/src/main/resources/web/js/zk/dateImpl.ts and 11 other locations - About 35 mins to fix
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 125..127
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 152..154
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 160..162
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 164..166
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 173..175
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 177..179
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 181..183
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 185..187
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 189..191
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 193..195
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 197..199

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

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

            setUTCHours(uTCHours: number): number {
                return this._getUTCMoment().hour(uTCHours).valueOf();
            }
    Severity: Major
    Found in zk/src/main/resources/web/js/zk/dateImpl.ts and 11 other locations - About 35 mins to fix
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 125..127
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 152..154
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 156..158
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 160..162
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 164..166
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 173..175
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 177..179
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 185..187
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 189..191
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 193..195
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 197..199

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

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

            setMilliseconds(milliseconds: number): number {
                return this._getTzMoment().millisecond(milliseconds).valueOf();
            }
    Severity: Major
    Found in zk/src/main/resources/web/js/zk/dateImpl.ts and 11 other locations - About 35 mins to fix
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 125..127
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 156..158
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 160..162
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 164..166
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 173..175
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 177..179
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 181..183
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 185..187
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 189..191
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 193..195
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 197..199

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

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

            setDate(date: number): number {
                return this._getTzMoment().date(date).valueOf();
            }
    Severity: Major
    Found in zk/src/main/resources/web/js/zk/dateImpl.ts and 11 other locations - About 35 mins to fix
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 152..154
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 156..158
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 160..162
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 164..166
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 173..175
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 177..179
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 181..183
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 185..187
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 189..191
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 193..195
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 197..199

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

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

            setSeconds(seconds: number): number {
                return this._getTzMoment().second(seconds).valueOf();
            }
    Severity: Major
    Found in zk/src/main/resources/web/js/zk/dateImpl.ts and 11 other locations - About 35 mins to fix
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 125..127
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 152..154
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 156..158
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 160..162
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 173..175
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 177..179
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 181..183
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 185..187
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 189..191
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 193..195
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 197..199

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

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

            setUTCDate(uTCDate: number): number {
                return this._getUTCMoment().date(uTCDate).valueOf();
            }
    Severity: Major
    Found in zk/src/main/resources/web/js/zk/dateImpl.ts and 11 other locations - About 35 mins to fix
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 125..127
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 152..154
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 156..158
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 160..162
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 164..166
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 177..179
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 181..183
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 185..187
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 189..191
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 193..195
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 197..199

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

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

            setUTCMilliseconds(uTCMilliseconds: number): number {
                return this._getUTCMoment().millisecond(uTCMilliseconds).valueOf();
            }
    Severity: Major
    Found in zk/src/main/resources/web/js/zk/dateImpl.ts and 11 other locations - About 35 mins to fix
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 125..127
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 152..154
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 156..158
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 160..162
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 164..166
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 173..175
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 177..179
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 181..183
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 189..191
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 193..195
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 197..199

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

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

            setUTCMinutes(uTCMinutes: number): number {
                return this._getUTCMoment().minute(uTCMinutes).valueOf();
            }
    Severity: Major
    Found in zk/src/main/resources/web/js/zk/dateImpl.ts and 11 other locations - About 35 mins to fix
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 125..127
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 152..154
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 156..158
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 160..162
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 164..166
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 173..175
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 177..179
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 181..183
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 185..187
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 193..195
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 197..199

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

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

            setMonth(month: number): number {
                return this._getTzMoment().month(month).valueOf();
            }
    Severity: Major
    Found in zk/src/main/resources/web/js/zk/dateImpl.ts and 11 other locations - About 35 mins to fix
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 125..127
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 152..154
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 156..158
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 164..166
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 173..175
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 177..179
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 181..183
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 185..187
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 189..191
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 193..195
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 197..199

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

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

            setUTCFullYear(uTCFullYear: number): number {
                return this._getUTCMoment().year(uTCFullYear).valueOf();
            }
    Severity: Major
    Found in zk/src/main/resources/web/js/zk/dateImpl.ts and 11 other locations - About 35 mins to fix
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 125..127
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 152..154
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 156..158
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 160..162
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 164..166
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 173..175
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 181..183
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 185..187
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 189..191
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 193..195
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 197..199

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

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

            setUTCSeconds(uTCSeconds: number): number {
                return this._getUTCMoment().second(uTCSeconds).valueOf();
            }
    Severity: Major
    Found in zk/src/main/resources/web/js/zk/dateImpl.ts and 11 other locations - About 35 mins to fix
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 125..127
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 152..154
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 156..158
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 160..162
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 164..166
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 173..175
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 177..179
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 181..183
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 185..187
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 189..191
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 193..195

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

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

            setUTCMonth(uTCMonth: number): number {
                return this._getUTCMoment().month(uTCMonth).valueOf();
            }
    Severity: Major
    Found in zk/src/main/resources/web/js/zk/dateImpl.ts and 11 other locations - About 35 mins to fix
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 125..127
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 152..154
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 156..158
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 160..162
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 164..166
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 173..175
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 177..179
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 181..183
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 185..187
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 189..191
    zk/src/main/resources/web/js/zk/dateImpl.ts on lines 197..199

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

    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