superdesk/superdesk-client-core

View on GitHub

Showing 3,654 of 3,654 total issues

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

                            var nextElem = elem.find('button:focus')
                                    .parent('li')
                                    .next()
                                    .children('button'),
                                categoryButton = elem.find('.levelup button');
Severity: Minor
Found in scripts/core/ui/ui.ts and 1 other location - About 45 mins to fix
scripts/core/ui/ui.ts on lines 148..152

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

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

                {
                    this.props.issues.map((str, i) => (
                        <div key={i} className="sd-line-input__message">{str}</div>
                    ))
                }
scripts/core/ui/components/generic-form/input-types/checkbox.tsx on lines 33..37
scripts/core/ui/components/generic-form/input-types/duration.tsx on lines 46..50
scripts/core/ui/components/generic-form/input-types/number.tsx on lines 37..41
scripts/core/ui/components/generic-form/input-types/plain-text.tsx on lines 49..53
scripts/core/ui/components/generic-form/input-types/select_multiple_values.tsx on lines 66..70
scripts/core/ui/components/generic-form/input-types/select_single_value.tsx on lines 119..123
scripts/core/ui/components/generic-form/input-types/select_single_value_autocomplete.tsx on lines 107..111
scripts/core/ui/components/generic-form/input-types/select_single_value_static.tsx on lines 53..57

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

        this.add = function() {
            element(by.className('icon-plus-sign')).click();
            browser.sleep(500);
        };
Severity: Major
Found in e2e/client/specs/helpers/highlights.ts and 7 other locations - About 40 mins to fix
e2e/client/specs/helpers/monitoring.ts on lines 554..557
e2e/client/specs/helpers/monitoring.ts on lines 559..562
e2e/client/specs/helpers/monitoring.ts on lines 564..567
e2e/client/specs/helpers/monitoring.ts on lines 569..572
e2e/client/specs/helpers/monitoring.ts on lines 574..577
e2e/client/specs/helpers/monitoring.ts on lines 579..582
e2e/client/specs/helpers/monitoring.ts on lines 716..719

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

                {
                    this.props.issues.map((str, i) => (
                        <div key={i} className="sd-line-input__message">{str}</div>
                    ))
                }
scripts/core/ui/components/generic-form/input-types/checkbox.tsx on lines 33..37
scripts/core/ui/components/generic-form/input-types/duration.tsx on lines 46..50
scripts/core/ui/components/generic-form/input-types/number.tsx on lines 37..41
scripts/core/ui/components/generic-form/input-types/plain-text.tsx on lines 49..53
scripts/core/ui/components/generic-form/input-types/select_multiple_values.tsx on lines 66..70
scripts/core/ui/components/generic-form/input-types/select_single_value.tsx on lines 119..123
scripts/core/ui/components/generic-form/input-types/select_single_value_autocomplete.tsx on lines 107..111
scripts/core/ui/components/generic-form/input-types/text-editor3.tsx on lines 40..44

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

        this.previousSearches = function() {
            element(by.id('previousBtn')).click();
            browser.sleep(500);
        };
Severity: Major
Found in e2e/client/specs/helpers/monitoring.ts and 7 other locations - About 40 mins to fix
e2e/client/specs/helpers/highlights.ts on lines 68..71
e2e/client/specs/helpers/monitoring.ts on lines 554..557
e2e/client/specs/helpers/monitoring.ts on lines 559..562
e2e/client/specs/helpers/monitoring.ts on lines 569..572
e2e/client/specs/helpers/monitoring.ts on lines 574..577
e2e/client/specs/helpers/monitoring.ts on lines 579..582
e2e/client/specs/helpers/monitoring.ts on lines 716..719

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

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

                    if (!done) {
                        WizardHandler.wizard('desks').next();
                    } else {
                        WizardHandler.wizard('desks').finish();
                    }
Severity: Major
Found in scripts/apps/desks/directives/DeskeditBasic.ts and 2 other locations - About 40 mins to fix
scripts/apps/desks/directives/DeskeditPeople.ts on lines 57..61
scripts/apps/desks/directives/DeskeditStages.ts on lines 111..115

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

                    {
                        this.props.issues.map((str, i) => (
                            <div key={i} className="sd-line-input__message">{str}</div>
                        ))
                    }
scripts/core/ui/components/generic-form/input-types/checkbox.tsx on lines 33..37
scripts/core/ui/components/generic-form/input-types/duration.tsx on lines 46..50
scripts/core/ui/components/generic-form/input-types/number.tsx on lines 37..41
scripts/core/ui/components/generic-form/input-types/plain-text.tsx on lines 49..53
scripts/core/ui/components/generic-form/input-types/select_multiple_values.tsx on lines 66..70
scripts/core/ui/components/generic-form/input-types/select_single_value_autocomplete.tsx on lines 107..111
scripts/core/ui/components/generic-form/input-types/select_single_value_static.tsx on lines 53..57
scripts/core/ui/components/generic-form/input-types/text-editor3.tsx on lines 40..44

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

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

                    if (!done) {
                        WizardHandler.wizard('desks').next();
                    } else {
                        WizardHandler.wizard('desks').finish();
                    }
Severity: Major
Found in scripts/apps/desks/directives/DeskeditPeople.ts and 2 other locations - About 40 mins to fix
scripts/apps/desks/directives/DeskeditBasic.ts on lines 46..50
scripts/apps/desks/directives/DeskeditStages.ts on lines 111..115

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

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

                if (!done) {
                    WizardHandler.wizard('desks').next();
                } else {
                    WizardHandler.wizard('desks').finish();
                }
Severity: Major
Found in scripts/apps/desks/directives/DeskeditStages.ts and 2 other locations - About 40 mins to fix
scripts/apps/desks/directives/DeskeditBasic.ts on lines 46..50
scripts/apps/desks/directives/DeskeditPeople.ts on lines 57..61

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

        const subitemTypes = Map<string, IVocabularyItem>(
            vocabulary.getVocabulary(RUNDOWN_SUBITEM_TYPES).items.map((item) => [item.qcode, item]),
        );
scripts/extensions/broadcasting/src/authoring-fields/subitems/subitems-view-edit.tsx on lines 49..51
scripts/extensions/broadcasting/src/rundowns/components/rundown-items.tsx on lines 63..65
scripts/extensions/broadcasting/src/rundowns/components/rundown-items.tsx on lines 67..69
scripts/extensions/broadcasting/src/rundowns/components/rundown-items.tsx on lines 71..73
scripts/extensions/broadcasting/src/rundowns/manage-rundown-items.tsx on lines 46..48

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

                {
                    this.props.issues.map((str, i) => (
                        <div key={i} className="sd-line-input__message">{str}</div>
                    ))
                }
scripts/core/ui/components/generic-form/input-types/duration.tsx on lines 46..50
scripts/core/ui/components/generic-form/input-types/number.tsx on lines 37..41
scripts/core/ui/components/generic-form/input-types/plain-text.tsx on lines 49..53
scripts/core/ui/components/generic-form/input-types/select_multiple_values.tsx on lines 66..70
scripts/core/ui/components/generic-form/input-types/select_single_value.tsx on lines 119..123
scripts/core/ui/components/generic-form/input-types/select_single_value_autocomplete.tsx on lines 107..111
scripts/core/ui/components/generic-form/input-types/select_single_value_static.tsx on lines 53..57
scripts/core/ui/components/generic-form/input-types/text-editor3.tsx on lines 40..44

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

        const subitemTypes = Map<string, IVocabularyItem>(
            vocabulary.getVocabulary(RUNDOWN_SUBITEM_TYPES).items.map((item) => [item.qcode, item]),
        );
scripts/extensions/broadcasting/src/authoring-fields/subitems/editor.tsx on lines 24..26
scripts/extensions/broadcasting/src/rundowns/components/rundown-items.tsx on lines 63..65
scripts/extensions/broadcasting/src/rundowns/components/rundown-items.tsx on lines 67..69
scripts/extensions/broadcasting/src/rundowns/components/rundown-items.tsx on lines 71..73
scripts/extensions/broadcasting/src/rundowns/manage-rundown-items.tsx on lines 46..48

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

        this.previousReorder = function() {
            element(by.id('previousBtn')).click();
            browser.sleep(500);
        };
Severity: Major
Found in e2e/client/specs/helpers/monitoring.ts and 7 other locations - About 40 mins to fix
e2e/client/specs/helpers/highlights.ts on lines 68..71
e2e/client/specs/helpers/monitoring.ts on lines 554..557
e2e/client/specs/helpers/monitoring.ts on lines 559..562
e2e/client/specs/helpers/monitoring.ts on lines 564..567
e2e/client/specs/helpers/monitoring.ts on lines 569..572
e2e/client/specs/helpers/monitoring.ts on lines 579..582
e2e/client/specs/helpers/monitoring.ts on lines 716..719

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

        const statuses = Map<string, IVocabularyItem>(
            vocabulary.getVocabulary(STATUS_VOCABULARY_ID).items.map((item) => [item.qcode, item]),
        );
scripts/extensions/broadcasting/src/authoring-fields/subitems/editor.tsx on lines 24..26
scripts/extensions/broadcasting/src/authoring-fields/subitems/subitems-view-edit.tsx on lines 49..51
scripts/extensions/broadcasting/src/rundowns/components/rundown-items.tsx on lines 67..69
scripts/extensions/broadcasting/src/rundowns/components/rundown-items.tsx on lines 71..73
scripts/extensions/broadcasting/src/rundowns/manage-rundown-items.tsx on lines 46..48

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

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

export function el(
    testIds: Array<string> | null = null,
    byLocator: Locator | null = null, // example: by.cssContainingText('option', 'Text')
    parent: ElementFinder | null = null,
): ElementFinder {
Severity: Minor
Found in end-to-end-testing-helpers/index.ts and 1 other location - About 40 mins to fix
end-to-end-testing-helpers/index.ts on lines 60..74

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

                {
                    this.props.issues.map((str, i) => (
                        <div key={i} className="sd-line-input__message">{str}</div>
                    ))
                }
Severity: Major
Found in scripts/core/ui/components/generic-form/input-types/number.tsx and 8 other locations - About 40 mins to fix
scripts/core/ui/components/generic-form/input-types/checkbox.tsx on lines 33..37
scripts/core/ui/components/generic-form/input-types/duration.tsx on lines 46..50
scripts/core/ui/components/generic-form/input-types/plain-text.tsx on lines 49..53
scripts/core/ui/components/generic-form/input-types/select_multiple_values.tsx on lines 66..70
scripts/core/ui/components/generic-form/input-types/select_single_value.tsx on lines 119..123
scripts/core/ui/components/generic-form/input-types/select_single_value_autocomplete.tsx on lines 107..111
scripts/core/ui/components/generic-form/input-types/select_single_value_static.tsx on lines 53..57
scripts/core/ui/components/generic-form/input-types/text-editor3.tsx on lines 40..44

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

                {
                    this.props.issues.map((str, i) => (
                        <div key={i} className="sd-line-input__message">{str}</div>
                    ))
                }
scripts/core/ui/components/generic-form/input-types/checkbox.tsx on lines 33..37
scripts/core/ui/components/generic-form/input-types/duration.tsx on lines 46..50
scripts/core/ui/components/generic-form/input-types/number.tsx on lines 37..41
scripts/core/ui/components/generic-form/input-types/select_multiple_values.tsx on lines 66..70
scripts/core/ui/components/generic-form/input-types/select_single_value.tsx on lines 119..123
scripts/core/ui/components/generic-form/input-types/select_single_value_autocomplete.tsx on lines 107..111
scripts/core/ui/components/generic-form/input-types/select_single_value_static.tsx on lines 53..57
scripts/core/ui/components/generic-form/input-types/text-editor3.tsx on lines 40..44

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

        const rundownItemTypes = Map<string, IVocabularyItem>(
            vocabulary.getVocabulary(RUNDOWN_ITEM_TYPES_VOCABULARY_ID).items.map((item) => [item.qcode, item]),
        );
scripts/extensions/broadcasting/src/authoring-fields/subitems/editor.tsx on lines 24..26
scripts/extensions/broadcasting/src/authoring-fields/subitems/subitems-view-edit.tsx on lines 49..51
scripts/extensions/broadcasting/src/rundowns/components/rundown-items.tsx on lines 63..65
scripts/extensions/broadcasting/src/rundowns/components/rundown-items.tsx on lines 67..69
scripts/extensions/broadcasting/src/rundowns/components/rundown-items.tsx on lines 71..73

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

                {
                    this.props.issues.map((str, i) => (
                        <div key={i} className="sd-line-input__message">{str}</div>
                    ))
                }
scripts/core/ui/components/generic-form/input-types/checkbox.tsx on lines 33..37
scripts/core/ui/components/generic-form/input-types/duration.tsx on lines 46..50
scripts/core/ui/components/generic-form/input-types/number.tsx on lines 37..41
scripts/core/ui/components/generic-form/input-types/plain-text.tsx on lines 49..53
scripts/core/ui/components/generic-form/input-types/select_single_value.tsx on lines 119..123
scripts/core/ui/components/generic-form/input-types/select_single_value_autocomplete.tsx on lines 107..111
scripts/core/ui/components/generic-form/input-types/select_single_value_static.tsx on lines 53..57
scripts/core/ui/components/generic-form/input-types/text-editor3.tsx on lines 40..44

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

        this.nextSearches = function() {
            element(by.id('nextBtn')).click();
            browser.sleep(500);
        };
Severity: Major
Found in e2e/client/specs/helpers/monitoring.ts and 7 other locations - About 40 mins to fix
e2e/client/specs/helpers/highlights.ts on lines 68..71
e2e/client/specs/helpers/monitoring.ts on lines 554..557
e2e/client/specs/helpers/monitoring.ts on lines 564..567
e2e/client/specs/helpers/monitoring.ts on lines 569..572
e2e/client/specs/helpers/monitoring.ts on lines 574..577
e2e/client/specs/helpers/monitoring.ts on lines 579..582
e2e/client/specs/helpers/monitoring.ts on lines 716..719

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

Severity
Category
Status
Source
Language