fewieden/MMM-soccer

View on GitHub
__tests__/MMM-soccer.specs.js

Summary

Maintainability
A
0 mins
Test Coverage

File MMM-soccer.specs.js has 320 lines of code (exceeds 250 allowed). Consider refactoring.
Wontfix

describe('MMM-soccer', () => {
    beforeAll(() => {
        require('../__mocks__/Logger');
        require('../__mocks__/Module');
    });
Severity: Minor
Found in __tests__/MMM-soccer.specs.js - About 3 hrs to fix

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

                test('returns empty string if focus === index', () => {
                    MMMsoccer.setConfig({max_teams: 7});
                    const fadeFilter = MMMsoccer.nunjucksEnvironment().addFilter.mock.calls[0][1];
    
                    expect(fadeFilter(3, 3)).toBe('');
    Severity: Major
    Found in __tests__/MMM-soccer.specs.js and 1 other location - About 2 hrs to fix
    __tests__/MMM-soccer.specs.js on lines 396..401

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

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

                test('returns opacity style', () => {
                    MMMsoccer.setConfig({max_teams: 7});
                    const fadeFilter = MMMsoccer.nunjucksEnvironment().addFilter.mock.calls[0][1];
    
                    expect(fadeFilter(1, 3)).toBe('opacity: 0.71');
    Severity: Major
    Found in __tests__/MMM-soccer.specs.js and 1 other location - About 2 hrs to fix
    __tests__/MMM-soccer.specs.js on lines 416..421

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

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

            test('returns top 5 teams and focus === -1', () => {
                MMMsoccer.setConfig({focus_on: {GERMANY: 'TOP'}, max_teams: 5});
    
                expect(MMMsoccer.calculateTeamDisplayBoundaries()).toMatchObject({
                    focusTeamIndex: -1,
    Severity: Major
    Found in __tests__/MMM-soccer.specs.js and 2 other locations - About 2 hrs to fix
    __tests__/MMM-soccer.specs.js on lines 332..340
    __tests__/MMM-soccer.specs.js on lines 352..360

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

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

            test('returns bottom 5 teams and focus === -1', () => {
                MMMsoccer.setConfig({focus_on: {GERMANY: 'BOTTOM'}, max_teams: 5});
    
                expect(MMMsoccer.calculateTeamDisplayBoundaries()).toMatchObject({
                    focusTeamIndex: -1,
    Severity: Major
    Found in __tests__/MMM-soccer.specs.js and 2 other locations - About 2 hrs to fix
    __tests__/MMM-soccer.specs.js on lines 322..330
    __tests__/MMM-soccer.specs.js on lines 332..340

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

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

            test('returns top 5 teams and focus === -1 if focus NOT found', () => {
                MMMsoccer.setConfig({focus_on: {GERMANY: 'anotherTeam'}, max_teams: 5});
    
                expect(MMMsoccer.calculateTeamDisplayBoundaries()).toMatchObject({
                    focusTeamIndex: -1,
    Severity: Major
    Found in __tests__/MMM-soccer.specs.js and 2 other locations - About 2 hrs to fix
    __tests__/MMM-soccer.specs.js on lines 322..330
    __tests__/MMM-soccer.specs.js on lines 352..360

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 4 locations. Consider refactoring.
    Wontfix

            test('returns top 5 teams and focus === 1 if focus is to close to top', () => {
                MMMsoccer.setConfig({focus_on: {GERMANY: 'team02'}, max_teams: 5});
    
                expect(MMMsoccer.calculateTeamDisplayBoundaries()).toMatchObject({
                    focusTeamIndex: 1,
    Severity: Major
    Found in __tests__/MMM-soccer.specs.js and 3 other locations - About 2 hrs to fix
    __tests__/MMM-soccer.specs.js on lines 312..320
    __tests__/MMM-soccer.specs.js on lines 362..370
    __tests__/MMM-soccer.specs.js on lines 372..380

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 4 locations. Consider refactoring.
    Wontfix

            test('returns 6 teams and index of focus team', () => {
                MMMsoccer.setConfig({focus_on: {GERMANY: 'team06'}, max_teams: 6});
    
                expect(MMMsoccer.calculateTeamDisplayBoundaries()).toMatchObject({
                    focusTeamIndex: 5,
    Severity: Major
    Found in __tests__/MMM-soccer.specs.js and 3 other locations - About 2 hrs to fix
    __tests__/MMM-soccer.specs.js on lines 312..320
    __tests__/MMM-soccer.specs.js on lines 342..350
    __tests__/MMM-soccer.specs.js on lines 362..370

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 4 locations. Consider refactoring.
    Wontfix

            test('returns 5 teams and index of focus team', () => {
                MMMsoccer.setConfig({focus_on: {GERMANY: 'team06'}, max_teams: 5});
    
                expect(MMMsoccer.calculateTeamDisplayBoundaries()).toMatchObject({
                    focusTeamIndex: 5,
    Severity: Major
    Found in __tests__/MMM-soccer.specs.js and 3 other locations - About 2 hrs to fix
    __tests__/MMM-soccer.specs.js on lines 342..350
    __tests__/MMM-soccer.specs.js on lines 362..370
    __tests__/MMM-soccer.specs.js on lines 372..380

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 4 locations. Consider refactoring.
    Wontfix

            test('returns bottom 5 teams and focus === 8 if focus is to close to bottom', () => {
                MMMsoccer.setConfig({focus_on: {GERMANY: 'team09'}, max_teams: 5});
    
                expect(MMMsoccer.calculateTeamDisplayBoundaries()).toMatchObject({
                    focusTeamIndex: 8,
    Severity: Major
    Found in __tests__/MMM-soccer.specs.js and 3 other locations - About 2 hrs to fix
    __tests__/MMM-soccer.specs.js on lines 312..320
    __tests__/MMM-soccer.specs.js on lines 342..350
    __tests__/MMM-soccer.specs.js on lines 372..380

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

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

            test('returns all teams and focus === -1 if focus NOT found WITHOUT max_teams', () => {
                MMMsoccer.setConfig({focus_on: {GERMANY: 'anotherTeam'}});
    
                expect(MMMsoccer.calculateTeamDisplayBoundaries()).toMatchObject({
                    focusTeamIndex: -1,
    Severity: Major
    Found in __tests__/MMM-soccer.specs.js and 2 other locations - About 2 hrs to fix
    __tests__/MMM-soccer.specs.js on lines 292..300
    __tests__/MMM-soccer.specs.js on lines 302..310

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

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

            test('returns all teams and focus === -1 if focus top WITHOUT max_teams', () => {
                MMMsoccer.setConfig({focus_on: {GERMANY: 'TOP'}});
    
                expect(MMMsoccer.calculateTeamDisplayBoundaries()).toMatchObject({
                    focusTeamIndex: -1,
    Severity: Major
    Found in __tests__/MMM-soccer.specs.js and 2 other locations - About 2 hrs to fix
    __tests__/MMM-soccer.specs.js on lines 282..290
    __tests__/MMM-soccer.specs.js on lines 302..310

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

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

            test('does NOTHING for other voice commands', () => {
                MMMsoccer.notificationReceived('VOICE_SOCCER', 'OTHER COMMAND', {name: 'MMM-voice'});
    
                expect(MMMsoccer.sendNotification).not.toHaveBeenCalled();
                expect(MMMsoccer.sendSocketNotification).not.toHaveBeenCalled();
    Severity: Major
    Found in __tests__/MMM-soccer.specs.js and 1 other location - About 2 hrs to fix
    __tests__/MMM-soccer.specs.js on lines 243..248

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

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

            test('returns all teams and focus === -1 if focus bottom WITHOUT max_teams', () => {
                MMMsoccer.setConfig({focus_on: {GERMANY: 'BOTTOM'}});
    
                expect(MMMsoccer.calculateTeamDisplayBoundaries()).toMatchObject({
                    focusTeamIndex: -1,
    Severity: Major
    Found in __tests__/MMM-soccer.specs.js and 2 other locations - About 2 hrs to fix
    __tests__/MMM-soccer.specs.js on lines 282..290
    __tests__/MMM-soccer.specs.js on lines 292..300

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

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

            test('does NOT switch league if league/country is unknown', () => {
                MMMsoccer.notificationReceived('VOICE_SOCCER', 'VIEW', {name: 'MMM-voice'});
    
                expect(MMMsoccer.sendNotification).not.toHaveBeenCalled();
                expect(MMMsoccer.sendSocketNotification).not.toHaveBeenCalled();
    Severity: Major
    Found in __tests__/MMM-soccer.specs.js and 1 other location - About 2 hrs to fix
    __tests__/MMM-soccer.specs.js on lines 250..255

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

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

            test('opens help modal', () => {
                MMMsoccer.notificationReceived('VOICE_SOCCER', 'OPEN HELP', {name: 'MMM-voice'});
    
                expect(MMMsoccer.sendNotification).toHaveBeenNthCalledWith(1, 'OPEN_MODAL', {
                    data: expect.any(Object),
    Severity: Major
    Found in __tests__/MMM-soccer.specs.js and 1 other location - About 1 hr to fix
    __tests__/MMM-soccer.specs.js on lines 204..211

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

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

            test('opens standings modal', () => {
                MMMsoccer.notificationReceived('VOICE_SOCCER', 'EXPAND VIEW', {name: 'MMM-voice'});
    
                expect(MMMsoccer.sendNotification).toHaveBeenNthCalledWith(1, 'OPEN_MODAL', {
                    data: expect.any(Object),
    Severity: Major
    Found in __tests__/MMM-soccer.specs.js and 1 other location - About 1 hr to fix
    __tests__/MMM-soccer.specs.js on lines 183..190

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

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

            test('does NOTHING if standings modal but NO expand/collapse keyword', () => {
                MMMsoccer.notificationReceived('VOICE_SOCCER', 'VIEW', {name: 'MMM-voice'});
    
                expect(MMMsoccer.sendNotification).not.toHaveBeenCalled();
            });
    Severity: Minor
    Found in __tests__/MMM-soccer.specs.js and 1 other location - About 55 mins to fix
    __tests__/MMM-soccer.specs.js on lines 198..202

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 54.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

            test('does NOTHING if help modal but NO open/close keyword', () => {
                MMMsoccer.notificationReceived('VOICE_SOCCER', 'HELP', {name: 'MMM-voice'});
    
                expect(MMMsoccer.sendNotification).not.toHaveBeenCalled();
            });
    Severity: Minor
    Found in __tests__/MMM-soccer.specs.js and 1 other location - About 55 mins to fix
    __tests__/MMM-soccer.specs.js on lines 219..223

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 54.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

            test('closes standings modal', () => {
                MMMsoccer.notificationReceived('VOICE_SOCCER', 'COLLAPSE VIEW', {name: 'MMM-voice'});
    
                expect(MMMsoccer.sendNotification).toHaveBeenNthCalledWith(1, 'CLOSE_MODAL');
            });
    Severity: Minor
    Found in __tests__/MMM-soccer.specs.js and 1 other location - About 50 mins to fix
    __tests__/MMM-soccer.specs.js on lines 192..196

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 52.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

            test('closes help modal', () => {
                MMMsoccer.notificationReceived('VOICE_SOCCER', 'CLOSE HELP', {name: 'MMM-voice'});
    
                expect(MMMsoccer.sendNotification).toHaveBeenNthCalledWith(1, 'CLOSE_MODAL');
            });
    Severity: Minor
    Found in __tests__/MMM-soccer.specs.js and 1 other location - About 50 mins to fix
    __tests__/MMM-soccer.specs.js on lines 213..217

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 52.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    There are no issues that match your filters.

    Category
    Status