linagora/openpaas-esn

View on GitHub
modules/linagora.esn.contact/frontend/app/contact/list/contact-list-card.directive.spec.js

Summary

Maintainability
F
3 days
Test Coverage

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

  it('should allow to click anywhere to view contact', function() {
    var element = initDirective();

    var isoScope = element.isolateScope();
    isoScope.displayContact = sinon.spy();
modules/linagora.esn.contact/frontend/app/contact/list/contact-list-item.directive.spec.js on lines 77..88

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

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

  it('should not display contact when click on phone', function() {
    $scope.contact.tel = [{ type: 'home', value: '123' }];
    var element = initDirective();

    var isoScope = element.isolateScope();
modules/linagora.esn.contact/frontend/app/contact/list/contact-list-card.directive.spec.js on lines 85..94
modules/linagora.esn.contact/frontend/app/contact/list/contact-list-item.directive.spec.js on lines 90..99
modules/linagora.esn.contact/frontend/app/contact/list/contact-list-item.directive.spec.js on lines 101..110

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

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

  it('should not display contact when click on email', function() {
    $scope.contact.emails = [{ type: 'home', value: 'me@home' }];
    var element = initDirective();

    var isoScope = element.isolateScope();
modules/linagora.esn.contact/frontend/app/contact/list/contact-list-card.directive.spec.js on lines 96..105
modules/linagora.esn.contact/frontend/app/contact/list/contact-list-item.directive.spec.js on lines 90..99
modules/linagora.esn.contact/frontend/app/contact/list/contact-list-item.directive.spec.js on lines 101..110

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

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

  it('should display work email if N emails are set', function() {
    var email = 'me@work.com';
    $scope.contact.emails = [{type: 'home', value: 'me@home'}, {type: 'work', value: email}];
    var element = initDirective();
    expect(element).to.contain(email);
modules/linagora.esn.contact/frontend/app/contact/list/contact-list-card.directive.spec.js on lines 51..56
modules/linagora.esn.contact/frontend/app/contact/list/contact-list-item.directive.spec.js on lines 56..61
modules/linagora.esn.contact/frontend/app/contact/list/contact-list-item.directive.spec.js on lines 70..75

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

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

  it('should display work phone if N phones are set', function() {
    var phone = '+33333333';
    $scope.contact.tel = [{type: 'home', value: 'homephone'}, {type: 'work', value: phone}];
    var element = initDirective();
    expect(element).to.contain(phone);
modules/linagora.esn.contact/frontend/app/contact/list/contact-list-card.directive.spec.js on lines 65..70
modules/linagora.esn.contact/frontend/app/contact/list/contact-list-item.directive.spec.js on lines 56..61
modules/linagora.esn.contact/frontend/app/contact/list/contact-list-item.directive.spec.js on lines 70..75

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

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

  it('should display phone', function() {
    var phone = '+33333333';
    $scope.contact.tel = [{type: 'work', value: phone}];
    var element = initDirective();
    expect(element).to.contain(phone);
modules/linagora.esn.contact/frontend/app/contact/list/contact-list-card.directive.spec.js on lines 58..63
modules/linagora.esn.contact/frontend/app/contact/list/contact-list-item.directive.spec.js on lines 49..54
modules/linagora.esn.contact/frontend/app/contact/list/contact-list-item.directive.spec.js on lines 63..68

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

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

  it('should display email', function() {
    var email = 'me@work.com';
    $scope.contact.emails = [{type: 'work', value: email}];
    var element = initDirective();
    expect(element).to.contain(email);
modules/linagora.esn.contact/frontend/app/contact/list/contact-list-card.directive.spec.js on lines 44..49
modules/linagora.esn.contact/frontend/app/contact/list/contact-list-item.directive.spec.js on lines 49..54
modules/linagora.esn.contact/frontend/app/contact/list/contact-list-item.directive.spec.js on lines 63..68

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

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

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

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

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

Refactorings

Further Reading

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

  it('should have cards size for contact avatar', function() {
    expect(initDirective().isolateScope().avatarSize).to.equal(CONTACT_AVATAR_SIZE.cards);
  });
modules/linagora.esn.contact/frontend/app/contact/list/contact-list-item.directive.spec.js on lines 40..42

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

There are no issues that match your filters.

Category
Status