mgcrea/angular-strap

View on GitHub
src/tooltip/test/tooltip.spec.js

Summary

Maintainability
F
1 mo
Test Coverage

File tooltip.spec.js has 1190 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';
/* global countScopes */

describe('tooltip', function() {

Severity: Major
Found in src/tooltip/test/tooltip.spec.js - About 3 days to fix

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

  describe('bsShow attribute', function() {
    it('should support setting to a boolean value', function() {
      var elm = compileDirective('bsShow-attr');
      expect(sandboxEl.children('.tooltip').length).toBe(1);
    });
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 1 other location - About 3 days to fix
src/dropdown/test/dropdown.spec.js on lines 218..266

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

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

    describe('container', function() {
      it('accepts element object', function() {
        var testElm = angular.element('<div></div>');
        sandboxEl.append(testElm);
        var myTooltip = $tooltip(sandboxEl, angular.extend({}, templates['default'].scope.tooltip, {container: testElm}));
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 1 other location - About 2 days to fix
src/popover/test/popover.spec.js on lines 424..453

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

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 support string values', function() {
      var elm = compileDirective('bsEnabled-attr-binding', { isEnabled: 'true' });
      angular.element(elm[0]).triggerHandler('mouseenter');
      $animate.flush();
      expect(sandboxEl.children('.tooltip').length).toBe(1);
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 1 other location - About 2 days to fix
src/popover/test/popover.spec.js on lines 266..291

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

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

  beforeEach(inject(function($injector) {
    $rootScope = $injector.get('$rootScope');
    $compile = $injector.get('$compile');
    $templateCache = $injector.get('$templateCache');
    $$rAF = $injector.get('$$rAF');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 1 other location - About 1 day to fix
src/modal/test/modal.spec.js on lines 19..36

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

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 destroy scopes when destroying directive scope', function() {
      var scopeCount = countScopes(scope, 0);
      var originalScope = scope;
      scope = scope.$new();
      var elm = compileDirective('default');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 3 other locations - About 7 hrs to fix
src/datepicker/test/datepicker.spec.js on lines 622..638
src/dropdown/test/dropdown.spec.js on lines 189..205
src/timepicker/test/timepicker.spec.js on lines 394..410

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

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 close on mouseleave when disabled', function() {
      var elm = compileDirective('bsEnabled-attr-binding');
      expect(sandboxEl.children('.tooltip').length).toBe(0);
      angular.element(elm[0]).triggerHandler('mouseenter');
      $animate.flush();
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 1 other location - About 7 hrs to fix
src/popover/test/popover.spec.js on lines 247..257

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

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 namespace show/hide events using the prefixEvent', function() {
      var myTooltip = $tooltip(sandboxEl, angular.extend({prefixEvent: 'datepicker'}, templates['default'].scope.tooltip));
      var emit = spyOn(myTooltip.$scope, '$emit');
      scope.$digest();
      myTooltip.show();
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 1 other location - About 6 hrs to fix
src/popover/test/popover.spec.js on lines 654..666

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

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

    describe('animation', function() {

      it('should default to `am-fade` animation', function() {
        var elm = compileDirective('default');
        angular.element(elm[0]).triggerHandler('mouseenter');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 6 other locations - About 6 hrs to fix
src/datepicker/test/datepicker.spec.js on lines 769..783
src/dropdown/test/dropdown.spec.js on lines 331..345
src/popover/test/popover.spec.js on lines 341..355
src/select/test/select.spec.js on lines 394..408
src/timepicker/test/timepicker.spec.js on lines 541..555
src/typeahead/test/typeahead.spec.js on lines 379..393

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

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 close on mouseleave when enabled', function() {
      var elm = compileDirective('bsEnabled-attr-binding');
      expect(sandboxEl.children('.tooltip').length).toBe(0);
      angular.element(elm[0]).triggerHandler('mouseenter');
      $animate.flush();
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 1 other location - About 6 hrs to fix
src/popover/test/popover.spec.js on lines 229..237

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

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 dispatch hide and hide.before events', function() {
      var myTooltip = $tooltip(sandboxEl, templates['default'].scope.tooltip);
      scope.$digest();
      myTooltip.show();

Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 1 other location - About 5 hrs to fix
src/popover/test/popover.spec.js on lines 310..323

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

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 dispatch show and show.before events', function() {
      var myTooltip = $tooltip(sandboxEl, templates['default'].scope.tooltip);
      var emit = spyOn(myTooltip.$scope, '$emit');
      scope.$digest();
      myTooltip.show();
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 1 other location - About 5 hrs to fix
src/popover/test/popover.spec.js on lines 297..308

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

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

    describe('onHide', function() {

      it('should invoke show event callback', function() {
        var hide = false;

Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 8 other locations - About 5 hrs to fix
src/alert/test/alert.spec.js on lines 394..411
src/aside/test/aside.spec.js on lines 399..416
src/datepicker/test/datepicker.spec.js on lines 1655..1672
src/dropdown/test/dropdown.spec.js on lines 529..546
src/modal/test/modal.spec.js on lines 849..866
src/popover/test/popover.spec.js on lines 634..651
src/timepicker/test/timepicker.spec.js on lines 710..727
src/typeahead/test/typeahead.spec.js on lines 655..672

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

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 support multiple delay', function(done) {
        var elm = compileDirective('options-delay-multiple');
        angular.element(elm[0]).triggerHandler('mouseenter');
        $animate.flush();

Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 1 other location - About 4 hrs to fix
src/tooltip/test/tooltip.spec.js on lines 837..847

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

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 support delay', function(done) {
        var elm = compileDirective('options-delay');
        angular.element(elm[0]).triggerHandler('mouseenter');
        $animate.flush();

Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 1 other location - About 4 hrs to fix
src/tooltip/test/tooltip.spec.js on lines 849..859

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

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 request custom template via $http only once', function() {
        $httpBackend.expectGET('custom').respond(200, '<div class="tooltip"><div class="tooltip-inner">foo: {{title}}</div></div>');
        var elm = compileDirective('options-template');
        var elmBis = compileDirective('options-template');
        $httpBackend.flush();
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 1 other location - About 4 hrs to fix
src/modal/test/modal.spec.js on lines 563..570

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

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

    describe('onBeforeHide', function() {

      it('should invoke beforeHide event callback', function() {
        var beforeHide = false;

Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 9 other locations - About 4 hrs to fix
src/alert/test/alert.spec.js on lines 376..392
src/aside/test/aside.spec.js on lines 381..397
src/datepicker/test/datepicker.spec.js on lines 1637..1653
src/dropdown/test/dropdown.spec.js on lines 511..527
src/modal/test/modal.spec.js on lines 831..847
src/popover/test/popover.spec.js on lines 616..632
src/timepicker/test/timepicker.spec.js on lines 692..708
src/typeahead/test/typeahead.spec.js on lines 601..617
src/typeahead/test/typeahead.spec.js on lines 637..653

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

        it('should remove `auto` from exotic placements when auto positioning', function () {
          var elm = compileDirective('options-placement-auto-exotic-top-left');
          angular.element(elm[0]).triggerHandler('mouseenter');

          // need to change the width and height so we don't trigger
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 2 other locations - About 4 hrs to fix
src/tooltip/test/tooltip.spec.js on lines 922..932
src/tooltip/test/tooltip.spec.js on lines 946..956

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

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

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

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

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

Refactorings

Further Reading

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

        it('should default to `top` when `auto` placement is set without a preference', function () {
          var elm = compileDirective('options-placement-auto');
          angular.element(elm[0]).triggerHandler('mouseenter');

          // need to change the width and height so we don't trigger
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 2 other locations - About 4 hrs to fix
src/tooltip/test/tooltip.spec.js on lines 922..932
src/tooltip/test/tooltip.spec.js on lines 934..944

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

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

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

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

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

Refactorings

Further Reading

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

        it('should remove `auto` from placements when auto positioning', function () {
          var elm = compileDirective('options-placement-auto-top');
          angular.element(elm[0]).triggerHandler('mouseenter');

          // need to change the width and height so we don't trigger
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 2 other locations - About 4 hrs to fix
src/tooltip/test/tooltip.spec.js on lines 934..944
src/tooltip/test/tooltip.spec.js on lines 946..956

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

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 request custom template via $http', function() {
        $httpBackend.expectGET('custom').respond(200, '<div class="tooltip"><div class="tooltip-inner">foo: {{title}}</div></div>');
        var elm = compileDirective('options-template');
        $httpBackend.flush();
        angular.element(elm[0]).triggerHandler('mouseenter');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 1 other location - About 4 hrs to fix
src/modal/test/modal.spec.js on lines 555..561

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

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

    describe('onShow', function() {

      it('should invoke show event callback', function() {
        var show = false;

Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 8 other locations - About 4 hrs to fix
src/alert/test/alert.spec.js on lines 358..374
src/aside/test/aside.spec.js on lines 363..379
src/datepicker/test/datepicker.spec.js on lines 1619..1635
src/dropdown/test/dropdown.spec.js on lines 493..509
src/modal/test/modal.spec.js on lines 813..829
src/popover/test/popover.spec.js on lines 598..614
src/timepicker/test/timepicker.spec.js on lines 674..690
src/typeahead/test/typeahead.spec.js on lines 619..635

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

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

    describe('titleTemplate', function() {

      it('should support custom titleTemplate', function() {
        $templateCache.put('custom', 'foo: {{title}}');
        var elm = compileDirective('options-titleTemplate');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 1 other location - About 3 hrs to fix
src/modal/test/modal.spec.js on lines 635..644

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

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 NOT stopPropagation on mousedown if mouseDownStopPropagation is false', function() {
      var elm = compileDirective('markup-button');
      var myTooltip = $tooltip(elm, {mouseDownStopPropagation: false, trigger: 'focus'});
      scope.$digest();
      var evt = jQuery.Event('mousedown');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 1 other location - About 3 hrs to fix
src/tooltip/test/tooltip.spec.js on lines 295..303

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

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 NOT preventDefault on mousedown if mouseDownPreventDefault is false', function() {
      var elm = compileDirective('markup-button');
      var myTooltip = $tooltip(elm, {mouseDownPreventDefault: false, trigger: 'focus'});
      scope.$digest();
      var evt = jQuery.Event('mousedown');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 1 other location - About 3 hrs to fix
src/tooltip/test/tooltip.spec.js on lines 285..293

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

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

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

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

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

Refactorings

Further Reading

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

    it('should open on mouseenter', function() {
      var elm = compileDirective('default');
      expect(sandboxEl.children('.tooltip').length).toBe(0);
      angular.element(elm[0]).triggerHandler('mouseenter');
      $animate.flush();
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 2 other locations - About 3 hrs to fix
src/tooltip/test/tooltip.spec.js on lines 400..406
src/tooltip/test/tooltip.spec.js on lines 408..414

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

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

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

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

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

Refactorings

Further Reading

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

    it('should support setting to a boolean value', function() {
      var elm = compileDirective('bsEnabled-attr');
      expect(sandboxEl.children('.tooltip').length).toBe(0);
      angular.element(elm[0]).triggerHandler('mouseenter');
      $animate.flush();
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 2 other locations - About 3 hrs to fix
src/tooltip/test/tooltip.spec.js on lines 227..233
src/tooltip/test/tooltip.spec.js on lines 408..414

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

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

  function compileDirective(template, locals) {
    template = templates[template];
    angular.extend(scope, template.scope || templates['default'].scope, locals);
    var element = $(template.element).appendTo(sandboxEl);
    element = $compile(element)(scope);
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 5 other locations - About 3 hrs to fix
src/alert/test/alert.spec.js on lines 79..86
src/aside/test/aside.spec.js on lines 71..78
src/modal/test/modal.spec.js on lines 119..126
src/navbar/test/navbar.spec.js on lines 47..54
src/popover/test/popover.spec.js on lines 114..121

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

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

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

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

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

Refactorings

Further Reading

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

    it('should open on mouseenter when enabled', function() {
      var elm = compileDirective('bsEnabled-attr-binding');
      expect(sandboxEl.children('.tooltip').length).toBe(0);
      angular.element(elm[0]).triggerHandler('mouseenter');
      $animate.flush();
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 2 other locations - About 3 hrs to fix
src/tooltip/test/tooltip.spec.js on lines 227..233
src/tooltip/test/tooltip.spec.js on lines 400..406

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

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

    it('should call show.before event with tooltip element instance id', function() {
      var elm = compileDirective('default-with-id');
      var id = "";
      scope.$on('tooltip.show.before', function(evt, tooltip) {
        id = tooltip.$id;
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 5 other locations - About 3 hrs to fix
src/datepicker/test/datepicker.spec.js on lines 753..763
src/dropdown/test/dropdown.spec.js on lines 315..325
src/modal/test/modal.spec.js on lines 349..359
src/popover/test/popover.spec.js on lines 325..335
src/timepicker/test/timepicker.spec.js on lines 525..535

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

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 support custom template loaded by ngInclude', function() {
        $templateCache.put('custom', [200, '<div class="tooltip"><div class="tooltip-inner">foo: {{title}}</div></div>', {}, 'OK']);
        var elm = compileDirective('options-template');
        angular.element(elm[0]).triggerHandler('mouseenter');
        expect(sandboxEl.find('.tooltip-inner').text()).toBe('foo: ' + scope.tooltip.title);
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 1 other location - About 3 hrs to fix
src/modal/test/modal.spec.js on lines 548..553

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

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

    describe('onBeforeShow', function() {

      it('should invoke beforeShow event callback', function() {
        var beforeShow = false;

Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 7 other locations - About 3 hrs to fix
src/alert/test/alert.spec.js on lines 341..356
src/aside/test/aside.spec.js on lines 346..361
src/datepicker/test/datepicker.spec.js on lines 1602..1617
src/dropdown/test/dropdown.spec.js on lines 476..491
src/modal/test/modal.spec.js on lines 796..811
src/popover/test/popover.spec.js on lines 581..596
src/timepicker/test/timepicker.spec.js on lines 657..672

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

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 support string value from within ngRepeat markup', function() {
      var elm = compileDirective('bsTooltip-ngRepeat-string');
      angular.element(elm.find('[bs-tooltip]')).triggerHandler('mouseenter');
      $animate.flush();
      expect(sandboxEl.find('.tooltip-inner').html()).toBe(scope.items[0].tooltip);
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 1 other location - About 3 hrs to fix
src/tooltip/test/tooltip.spec.js on lines 258..263

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

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 support ngRepeat markup', function() {
      var elm = compileDirective('markup-ngRepeat');
      angular.element(elm.find('[bs-tooltip]')).triggerHandler('mouseenter');
      $animate.flush();
      expect(sandboxEl.find('.tooltip-inner').html()).toBe(scope.items[0].tooltip);
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 1 other location - About 3 hrs to fix
src/tooltip/test/tooltip.spec.js on lines 491..496

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

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

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

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

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

Refactorings

Further Reading

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

    it('should correctly compile inner content', function() {
      var elm = compileDirective('default');
      angular.element(elm[0]).triggerHandler('mouseenter');
      $animate.flush();
      expect(sandboxEl.find('.tooltip-inner').html()).toBe(scope.tooltip.title);
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 2 other locations - About 3 hrs to fix
src/tooltip/test/tooltip.spec.js on lines 251..256
src/tooltip/test/tooltip.spec.js on lines 484..489

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

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

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

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

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

Refactorings

Further Reading

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

    it('should support scope as object', function() {
      var elm = compileDirective('markup-scope');
      angular.element(elm[0]).triggerHandler('mouseenter');
      $animate.flush();
      expect(sandboxEl.find('.tooltip-inner').html()).toBe(scope.tooltip.title);
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 2 other locations - About 3 hrs to fix
src/tooltip/test/tooltip.spec.js on lines 244..249
src/tooltip/test/tooltip.spec.js on lines 484..489

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

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

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

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

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

Refactorings

Further Reading

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

    it('should support string value', function() {
      var elm = compileDirective('bsTooltip-string');
      angular.element(elm[0]).triggerHandler('mouseenter');
      $animate.flush();
      expect(sandboxEl.find('.tooltip-inner').html()).toBe(scope.tooltip.title);
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 2 other locations - About 3 hrs to fix
src/tooltip/test/tooltip.spec.js on lines 244..249
src/tooltip/test/tooltip.spec.js on lines 251..256

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

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 support undefined value', function() {
      var elm = compileDirective('bsEnabled-attr-binding', { isEnabled: undefined });
      angular.element(elm[0]).triggerHandler('mouseenter');
      $animate.flush();
      expect(sandboxEl.children('.tooltip').length).toBe(1);
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 1 other location - About 2 hrs to fix
src/popover/test/popover.spec.js on lines 259..264

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

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

      it('should position the tooltip to the bottom-left of the target when initial placement results in positioning outside its container', function () {
        var autoTopRight = autoPlacements['options-placement-auto-exotic-top-right'];
        var bottomLeft = standardPlacements['options-placement-exotic-bottom-left'];

        // should swap to bottom-left and match the standard bottom-left
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 7 other locations - About 2 hrs to fix
src/tooltip/test/tooltip.spec.js on lines 1335..1342
src/tooltip/test/tooltip.spec.js on lines 1344..1351
src/tooltip/test/tooltip.spec.js on lines 1353..1360
src/tooltip/test/tooltip.spec.js on lines 1362..1369
src/tooltip/test/tooltip.spec.js on lines 1380..1387
src/tooltip/test/tooltip.spec.js on lines 1389..1396
src/tooltip/test/tooltip.spec.js on lines 1398..1405

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

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

      it('should position the tooltip above the target when initial placement results in positioning outside its container', function () {
        var autoBottom = autoPlacements['options-placement-auto-bottom'];
        var top = standardPlacements['options-placement-top'];

        // bottom is offscreen, so it should swap to top and match the standard top
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 7 other locations - About 2 hrs to fix
src/tooltip/test/tooltip.spec.js on lines 1335..1342
src/tooltip/test/tooltip.spec.js on lines 1344..1351
src/tooltip/test/tooltip.spec.js on lines 1362..1369
src/tooltip/test/tooltip.spec.js on lines 1371..1378
src/tooltip/test/tooltip.spec.js on lines 1380..1387
src/tooltip/test/tooltip.spec.js on lines 1389..1396
src/tooltip/test/tooltip.spec.js on lines 1398..1405

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

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

      it('should position the tooltip to the top-left of the target when initial placement results in positioning outside its container', function () {
        var autoBottomLeft = autoPlacements['options-placement-auto-exotic-bottom-left'];
        var topRight = standardPlacements['options-placement-exotic-top-right'];

        // should swap to top-right and match the standard top-right
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 7 other locations - About 2 hrs to fix
src/tooltip/test/tooltip.spec.js on lines 1335..1342
src/tooltip/test/tooltip.spec.js on lines 1344..1351
src/tooltip/test/tooltip.spec.js on lines 1353..1360
src/tooltip/test/tooltip.spec.js on lines 1362..1369
src/tooltip/test/tooltip.spec.js on lines 1371..1378
src/tooltip/test/tooltip.spec.js on lines 1380..1387
src/tooltip/test/tooltip.spec.js on lines 1389..1396

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

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

      it('should position the tooltip below the target when initial placement results in positioning outside its container', function () {
        var autoTop = autoPlacements['options-placement-auto-top'];
        var bottom = standardPlacements['options-placement-bottom'];

        // top is offscreen, so it should swap to bottom and match the standard bottom
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 7 other locations - About 2 hrs to fix
src/tooltip/test/tooltip.spec.js on lines 1344..1351
src/tooltip/test/tooltip.spec.js on lines 1353..1360
src/tooltip/test/tooltip.spec.js on lines 1362..1369
src/tooltip/test/tooltip.spec.js on lines 1371..1378
src/tooltip/test/tooltip.spec.js on lines 1380..1387
src/tooltip/test/tooltip.spec.js on lines 1389..1396
src/tooltip/test/tooltip.spec.js on lines 1398..1405

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

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

      it('should position the tooltip to the right of the target when initial placement results in positioning outside its container', function () {
        var autoLeft = autoPlacements['options-placement-auto-left'];
        var right = standardPlacements['options-placement-right'];

        // left is offscreen, so it should swap to right and match the standard right
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 7 other locations - About 2 hrs to fix
src/tooltip/test/tooltip.spec.js on lines 1335..1342
src/tooltip/test/tooltip.spec.js on lines 1344..1351
src/tooltip/test/tooltip.spec.js on lines 1353..1360
src/tooltip/test/tooltip.spec.js on lines 1371..1378
src/tooltip/test/tooltip.spec.js on lines 1380..1387
src/tooltip/test/tooltip.spec.js on lines 1389..1396
src/tooltip/test/tooltip.spec.js on lines 1398..1405

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

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

      it('should position the tooltip to the top-left of the target when initial placement results in positioning outside its container', function () {
        var autoBottomRight = autoPlacements['options-placement-auto-exotic-bottom-right'];
        var topLeft = standardPlacements['options-placement-exotic-top-left'];

        // should swap to top-left and match the standard top-left
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 7 other locations - About 2 hrs to fix
src/tooltip/test/tooltip.spec.js on lines 1335..1342
src/tooltip/test/tooltip.spec.js on lines 1344..1351
src/tooltip/test/tooltip.spec.js on lines 1353..1360
src/tooltip/test/tooltip.spec.js on lines 1362..1369
src/tooltip/test/tooltip.spec.js on lines 1371..1378
src/tooltip/test/tooltip.spec.js on lines 1380..1387
src/tooltip/test/tooltip.spec.js on lines 1398..1405

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

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

      it('should position the tooltip to the left of the target when initial placement results in positioning outside its container', function () {
        var autoRight = autoPlacements['options-placement-auto-right'];
        var left = standardPlacements['options-placement-left'];

        // right is offscreen, so it should swap to left and match the standard left
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 7 other locations - About 2 hrs to fix
src/tooltip/test/tooltip.spec.js on lines 1335..1342
src/tooltip/test/tooltip.spec.js on lines 1353..1360
src/tooltip/test/tooltip.spec.js on lines 1362..1369
src/tooltip/test/tooltip.spec.js on lines 1371..1378
src/tooltip/test/tooltip.spec.js on lines 1380..1387
src/tooltip/test/tooltip.spec.js on lines 1389..1396
src/tooltip/test/tooltip.spec.js on lines 1398..1405

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

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

      it('should position the tooltip to the bottom-right of the target when initial placement results in positioning outside its container', function () {
        var autoTopLeft = autoPlacements['options-placement-auto-exotic-top-left'];
        var bottomRight = standardPlacements['options-placement-exotic-bottom-right'];

        // should swap to bottom-right and match the standard bottom-right
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 7 other locations - About 2 hrs to fix
src/tooltip/test/tooltip.spec.js on lines 1335..1342
src/tooltip/test/tooltip.spec.js on lines 1344..1351
src/tooltip/test/tooltip.spec.js on lines 1353..1360
src/tooltip/test/tooltip.spec.js on lines 1362..1369
src/tooltip/test/tooltip.spec.js on lines 1371..1378
src/tooltip/test/tooltip.spec.js on lines 1389..1396
src/tooltip/test/tooltip.spec.js on lines 1398..1405

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

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

      it('should shift up when positioning results in being outside of the viewport', function () {
        var top = viewportPlacements['options-placement-viewport-left'];

        expect(top.top).toBe('100px');
        expect(top.left).toBe('80px');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 17 other locations - About 1 hr to fix
src/tooltip/test/tooltip.spec.js on lines 1249..1254
src/tooltip/test/tooltip.spec.js on lines 1256..1261
src/tooltip/test/tooltip.spec.js on lines 1263..1268
src/tooltip/test/tooltip.spec.js on lines 1270..1275
src/tooltip/test/tooltip.spec.js on lines 1277..1282
src/tooltip/test/tooltip.spec.js on lines 1284..1289
src/tooltip/test/tooltip.spec.js on lines 1291..1296
src/tooltip/test/tooltip.spec.js on lines 1298..1303
src/tooltip/test/tooltip.spec.js on lines 1305..1310
src/tooltip/test/tooltip.spec.js on lines 1312..1317
src/tooltip/test/tooltip.spec.js on lines 1319..1324
src/tooltip/test/tooltip.spec.js on lines 1326..1331
src/tooltip/test/tooltip.spec.js on lines 1409..1414
src/tooltip/test/tooltip.spec.js on lines 1416..1421
src/tooltip/test/tooltip.spec.js on lines 1423..1428
src/tooltip/test/tooltip.spec.js on lines 1437..1442
src/tooltip/test/tooltip.spec.js on lines 1444..1449

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

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

      it('should position the tooltip below the target when placement is `bottom`', function () {
        var placement = standardPlacements['options-placement-bottom'];

        expect(placement.top).toBe('20px');
        expect(placement.left).toBe('-90px');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 17 other locations - About 1 hr to fix
src/tooltip/test/tooltip.spec.js on lines 1249..1254
src/tooltip/test/tooltip.spec.js on lines 1256..1261
src/tooltip/test/tooltip.spec.js on lines 1270..1275
src/tooltip/test/tooltip.spec.js on lines 1277..1282
src/tooltip/test/tooltip.spec.js on lines 1284..1289
src/tooltip/test/tooltip.spec.js on lines 1291..1296
src/tooltip/test/tooltip.spec.js on lines 1298..1303
src/tooltip/test/tooltip.spec.js on lines 1305..1310
src/tooltip/test/tooltip.spec.js on lines 1312..1317
src/tooltip/test/tooltip.spec.js on lines 1319..1324
src/tooltip/test/tooltip.spec.js on lines 1326..1331
src/tooltip/test/tooltip.spec.js on lines 1409..1414
src/tooltip/test/tooltip.spec.js on lines 1416..1421
src/tooltip/test/tooltip.spec.js on lines 1423..1428
src/tooltip/test/tooltip.spec.js on lines 1430..1435
src/tooltip/test/tooltip.spec.js on lines 1437..1442
src/tooltip/test/tooltip.spec.js on lines 1444..1449

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

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

      it('should position the tooltip to the left-bottom of the target when placement is `left-bottom`', function () {
        var placement = standardPlacements['options-placement-exotic-left-bottom'];

        expect(placement.top).toBe('0px');
        expect(placement.left).toBe('-200px');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 17 other locations - About 1 hr to fix
src/tooltip/test/tooltip.spec.js on lines 1249..1254
src/tooltip/test/tooltip.spec.js on lines 1256..1261
src/tooltip/test/tooltip.spec.js on lines 1263..1268
src/tooltip/test/tooltip.spec.js on lines 1270..1275
src/tooltip/test/tooltip.spec.js on lines 1277..1282
src/tooltip/test/tooltip.spec.js on lines 1284..1289
src/tooltip/test/tooltip.spec.js on lines 1291..1296
src/tooltip/test/tooltip.spec.js on lines 1298..1303
src/tooltip/test/tooltip.spec.js on lines 1305..1310
src/tooltip/test/tooltip.spec.js on lines 1319..1324
src/tooltip/test/tooltip.spec.js on lines 1326..1331
src/tooltip/test/tooltip.spec.js on lines 1409..1414
src/tooltip/test/tooltip.spec.js on lines 1416..1421
src/tooltip/test/tooltip.spec.js on lines 1423..1428
src/tooltip/test/tooltip.spec.js on lines 1430..1435
src/tooltip/test/tooltip.spec.js on lines 1437..1442
src/tooltip/test/tooltip.spec.js on lines 1444..1449

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

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

      it('should shift down when positioning results in being outsie of the viewport', function () {
        var right = viewportPlacements['options-placement-viewport-right'];

        expect(right.top).toBe('0px');
        expect(right.left).toBe('20px');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 17 other locations - About 1 hr to fix
src/tooltip/test/tooltip.spec.js on lines 1249..1254
src/tooltip/test/tooltip.spec.js on lines 1256..1261
src/tooltip/test/tooltip.spec.js on lines 1263..1268
src/tooltip/test/tooltip.spec.js on lines 1270..1275
src/tooltip/test/tooltip.spec.js on lines 1277..1282
src/tooltip/test/tooltip.spec.js on lines 1284..1289
src/tooltip/test/tooltip.spec.js on lines 1291..1296
src/tooltip/test/tooltip.spec.js on lines 1298..1303
src/tooltip/test/tooltip.spec.js on lines 1305..1310
src/tooltip/test/tooltip.spec.js on lines 1312..1317
src/tooltip/test/tooltip.spec.js on lines 1319..1324
src/tooltip/test/tooltip.spec.js on lines 1326..1331
src/tooltip/test/tooltip.spec.js on lines 1416..1421
src/tooltip/test/tooltip.spec.js on lines 1423..1428
src/tooltip/test/tooltip.spec.js on lines 1430..1435
src/tooltip/test/tooltip.spec.js on lines 1437..1442
src/tooltip/test/tooltip.spec.js on lines 1444..1449

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

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

      it('should ignore exotic placements', function () {
        var exotic = viewportPlacements['options-placement-viewport-exotic'];

        expect(exotic.top).toBe('20px');
        expect(exotic.left).toBe('-80px');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 17 other locations - About 1 hr to fix
src/tooltip/test/tooltip.spec.js on lines 1249..1254
src/tooltip/test/tooltip.spec.js on lines 1256..1261
src/tooltip/test/tooltip.spec.js on lines 1263..1268
src/tooltip/test/tooltip.spec.js on lines 1270..1275
src/tooltip/test/tooltip.spec.js on lines 1277..1282
src/tooltip/test/tooltip.spec.js on lines 1284..1289
src/tooltip/test/tooltip.spec.js on lines 1291..1296
src/tooltip/test/tooltip.spec.js on lines 1298..1303
src/tooltip/test/tooltip.spec.js on lines 1305..1310
src/tooltip/test/tooltip.spec.js on lines 1312..1317
src/tooltip/test/tooltip.spec.js on lines 1319..1324
src/tooltip/test/tooltip.spec.js on lines 1326..1331
src/tooltip/test/tooltip.spec.js on lines 1409..1414
src/tooltip/test/tooltip.spec.js on lines 1416..1421
src/tooltip/test/tooltip.spec.js on lines 1423..1428
src/tooltip/test/tooltip.spec.js on lines 1430..1435
src/tooltip/test/tooltip.spec.js on lines 1437..1442

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

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

      it('should position the tooltip to the top-left of the target when placement is `top-left`', function () {
        var placement = standardPlacements['options-placement-exotic-top-left'];

        expect(placement.top).toBe('-100px');
        expect(placement.left).toBe('0px');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 17 other locations - About 1 hr to fix
src/tooltip/test/tooltip.spec.js on lines 1249..1254
src/tooltip/test/tooltip.spec.js on lines 1256..1261
src/tooltip/test/tooltip.spec.js on lines 1263..1268
src/tooltip/test/tooltip.spec.js on lines 1270..1275
src/tooltip/test/tooltip.spec.js on lines 1284..1289
src/tooltip/test/tooltip.spec.js on lines 1291..1296
src/tooltip/test/tooltip.spec.js on lines 1298..1303
src/tooltip/test/tooltip.spec.js on lines 1305..1310
src/tooltip/test/tooltip.spec.js on lines 1312..1317
src/tooltip/test/tooltip.spec.js on lines 1319..1324
src/tooltip/test/tooltip.spec.js on lines 1326..1331
src/tooltip/test/tooltip.spec.js on lines 1409..1414
src/tooltip/test/tooltip.spec.js on lines 1416..1421
src/tooltip/test/tooltip.spec.js on lines 1423..1428
src/tooltip/test/tooltip.spec.js on lines 1430..1435
src/tooltip/test/tooltip.spec.js on lines 1437..1442
src/tooltip/test/tooltip.spec.js on lines 1444..1449

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

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

      it('should use the padding to position the tooltip from the edge of the viewport', function () {
        var padding = viewportPlacements['options-placement-viewport-padding'];

        expect(padding.top).toBe('10px');
        expect(padding.left).toBe('20px');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 17 other locations - About 1 hr to fix
src/tooltip/test/tooltip.spec.js on lines 1249..1254
src/tooltip/test/tooltip.spec.js on lines 1256..1261
src/tooltip/test/tooltip.spec.js on lines 1263..1268
src/tooltip/test/tooltip.spec.js on lines 1270..1275
src/tooltip/test/tooltip.spec.js on lines 1277..1282
src/tooltip/test/tooltip.spec.js on lines 1284..1289
src/tooltip/test/tooltip.spec.js on lines 1291..1296
src/tooltip/test/tooltip.spec.js on lines 1298..1303
src/tooltip/test/tooltip.spec.js on lines 1305..1310
src/tooltip/test/tooltip.spec.js on lines 1312..1317
src/tooltip/test/tooltip.spec.js on lines 1319..1324
src/tooltip/test/tooltip.spec.js on lines 1326..1331
src/tooltip/test/tooltip.spec.js on lines 1409..1414
src/tooltip/test/tooltip.spec.js on lines 1416..1421
src/tooltip/test/tooltip.spec.js on lines 1423..1428
src/tooltip/test/tooltip.spec.js on lines 1430..1435
src/tooltip/test/tooltip.spec.js on lines 1444..1449

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

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

      it('should position the tooltip to the bottom-left of the target when placement is `bottom-left`', function () {
        var placement = standardPlacements['options-placement-exotic-bottom-left'];

        expect(placement.top).toBe('20px');
        expect(placement.left).toBe('0px');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 17 other locations - About 1 hr to fix
src/tooltip/test/tooltip.spec.js on lines 1249..1254
src/tooltip/test/tooltip.spec.js on lines 1256..1261
src/tooltip/test/tooltip.spec.js on lines 1263..1268
src/tooltip/test/tooltip.spec.js on lines 1270..1275
src/tooltip/test/tooltip.spec.js on lines 1277..1282
src/tooltip/test/tooltip.spec.js on lines 1284..1289
src/tooltip/test/tooltip.spec.js on lines 1298..1303
src/tooltip/test/tooltip.spec.js on lines 1305..1310
src/tooltip/test/tooltip.spec.js on lines 1312..1317
src/tooltip/test/tooltip.spec.js on lines 1319..1324
src/tooltip/test/tooltip.spec.js on lines 1326..1331
src/tooltip/test/tooltip.spec.js on lines 1409..1414
src/tooltip/test/tooltip.spec.js on lines 1416..1421
src/tooltip/test/tooltip.spec.js on lines 1423..1428
src/tooltip/test/tooltip.spec.js on lines 1430..1435
src/tooltip/test/tooltip.spec.js on lines 1437..1442
src/tooltip/test/tooltip.spec.js on lines 1444..1449

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

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

      it('should position the tooltip to the left-top of the target when placement is `left-top`', function () {
        var placement = standardPlacements['options-placement-exotic-left-top'];

        expect(placement.top).toBe('-80px');
        expect(placement.left).toBe('-200px');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 17 other locations - About 1 hr to fix
src/tooltip/test/tooltip.spec.js on lines 1249..1254
src/tooltip/test/tooltip.spec.js on lines 1256..1261
src/tooltip/test/tooltip.spec.js on lines 1263..1268
src/tooltip/test/tooltip.spec.js on lines 1270..1275
src/tooltip/test/tooltip.spec.js on lines 1277..1282
src/tooltip/test/tooltip.spec.js on lines 1284..1289
src/tooltip/test/tooltip.spec.js on lines 1291..1296
src/tooltip/test/tooltip.spec.js on lines 1298..1303
src/tooltip/test/tooltip.spec.js on lines 1312..1317
src/tooltip/test/tooltip.spec.js on lines 1319..1324
src/tooltip/test/tooltip.spec.js on lines 1326..1331
src/tooltip/test/tooltip.spec.js on lines 1409..1414
src/tooltip/test/tooltip.spec.js on lines 1416..1421
src/tooltip/test/tooltip.spec.js on lines 1423..1428
src/tooltip/test/tooltip.spec.js on lines 1430..1435
src/tooltip/test/tooltip.spec.js on lines 1437..1442
src/tooltip/test/tooltip.spec.js on lines 1444..1449

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

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

      it('should shift right when positioning results in being outside of the viewport', function () {
        var top = viewportPlacements['options-placement-viewport-top'];

        expect(top.top).toBe('80px');
        expect(top.left).toBe('0px');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 17 other locations - About 1 hr to fix
src/tooltip/test/tooltip.spec.js on lines 1249..1254
src/tooltip/test/tooltip.spec.js on lines 1256..1261
src/tooltip/test/tooltip.spec.js on lines 1263..1268
src/tooltip/test/tooltip.spec.js on lines 1270..1275
src/tooltip/test/tooltip.spec.js on lines 1277..1282
src/tooltip/test/tooltip.spec.js on lines 1284..1289
src/tooltip/test/tooltip.spec.js on lines 1291..1296
src/tooltip/test/tooltip.spec.js on lines 1298..1303
src/tooltip/test/tooltip.spec.js on lines 1305..1310
src/tooltip/test/tooltip.spec.js on lines 1312..1317
src/tooltip/test/tooltip.spec.js on lines 1319..1324
src/tooltip/test/tooltip.spec.js on lines 1326..1331
src/tooltip/test/tooltip.spec.js on lines 1409..1414
src/tooltip/test/tooltip.spec.js on lines 1416..1421
src/tooltip/test/tooltip.spec.js on lines 1430..1435
src/tooltip/test/tooltip.spec.js on lines 1437..1442
src/tooltip/test/tooltip.spec.js on lines 1444..1449

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

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

      it('should position the tooltip above the target when placement is `top`', function () {
        var placement = standardPlacements['options-placement-top'];

        expect(placement.top).toBe('-100px');
        expect(placement.left).toBe('-90px');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 17 other locations - About 1 hr to fix
src/tooltip/test/tooltip.spec.js on lines 1256..1261
src/tooltip/test/tooltip.spec.js on lines 1263..1268
src/tooltip/test/tooltip.spec.js on lines 1270..1275
src/tooltip/test/tooltip.spec.js on lines 1277..1282
src/tooltip/test/tooltip.spec.js on lines 1284..1289
src/tooltip/test/tooltip.spec.js on lines 1291..1296
src/tooltip/test/tooltip.spec.js on lines 1298..1303
src/tooltip/test/tooltip.spec.js on lines 1305..1310
src/tooltip/test/tooltip.spec.js on lines 1312..1317
src/tooltip/test/tooltip.spec.js on lines 1319..1324
src/tooltip/test/tooltip.spec.js on lines 1326..1331
src/tooltip/test/tooltip.spec.js on lines 1409..1414
src/tooltip/test/tooltip.spec.js on lines 1416..1421
src/tooltip/test/tooltip.spec.js on lines 1423..1428
src/tooltip/test/tooltip.spec.js on lines 1430..1435
src/tooltip/test/tooltip.spec.js on lines 1437..1442
src/tooltip/test/tooltip.spec.js on lines 1444..1449

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

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

      it('should position the tooltip to the top-right of the target when placement is `top-right`', function () {
        var placement = standardPlacements['options-placement-exotic-top-right'];

        expect(placement.top).toBe('-100px');
        expect(placement.left).toBe('-180px');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 17 other locations - About 1 hr to fix
src/tooltip/test/tooltip.spec.js on lines 1249..1254
src/tooltip/test/tooltip.spec.js on lines 1256..1261
src/tooltip/test/tooltip.spec.js on lines 1263..1268
src/tooltip/test/tooltip.spec.js on lines 1270..1275
src/tooltip/test/tooltip.spec.js on lines 1277..1282
src/tooltip/test/tooltip.spec.js on lines 1291..1296
src/tooltip/test/tooltip.spec.js on lines 1298..1303
src/tooltip/test/tooltip.spec.js on lines 1305..1310
src/tooltip/test/tooltip.spec.js on lines 1312..1317
src/tooltip/test/tooltip.spec.js on lines 1319..1324
src/tooltip/test/tooltip.spec.js on lines 1326..1331
src/tooltip/test/tooltip.spec.js on lines 1409..1414
src/tooltip/test/tooltip.spec.js on lines 1416..1421
src/tooltip/test/tooltip.spec.js on lines 1423..1428
src/tooltip/test/tooltip.spec.js on lines 1430..1435
src/tooltip/test/tooltip.spec.js on lines 1437..1442
src/tooltip/test/tooltip.spec.js on lines 1444..1449

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

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

      it('should position the tooltip to the left of the target when placement is `left`', function () {
        var placement = standardPlacements['options-placement-left'];

        expect(placement.top).toBe('-40px');
        expect(placement.left).toBe('-200px');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 17 other locations - About 1 hr to fix
src/tooltip/test/tooltip.spec.js on lines 1249..1254
src/tooltip/test/tooltip.spec.js on lines 1256..1261
src/tooltip/test/tooltip.spec.js on lines 1263..1268
src/tooltip/test/tooltip.spec.js on lines 1277..1282
src/tooltip/test/tooltip.spec.js on lines 1284..1289
src/tooltip/test/tooltip.spec.js on lines 1291..1296
src/tooltip/test/tooltip.spec.js on lines 1298..1303
src/tooltip/test/tooltip.spec.js on lines 1305..1310
src/tooltip/test/tooltip.spec.js on lines 1312..1317
src/tooltip/test/tooltip.spec.js on lines 1319..1324
src/tooltip/test/tooltip.spec.js on lines 1326..1331
src/tooltip/test/tooltip.spec.js on lines 1409..1414
src/tooltip/test/tooltip.spec.js on lines 1416..1421
src/tooltip/test/tooltip.spec.js on lines 1423..1428
src/tooltip/test/tooltip.spec.js on lines 1430..1435
src/tooltip/test/tooltip.spec.js on lines 1437..1442
src/tooltip/test/tooltip.spec.js on lines 1444..1449

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

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

      it('should position the tooltip to the right-bottom of the target when placement is `right-bottom`', function () {
        var placement = standardPlacements['options-placement-exotic-right-bottom'];

        expect(placement.top).toBe('0px');
        expect(placement.left).toBe('20px');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 17 other locations - About 1 hr to fix
src/tooltip/test/tooltip.spec.js on lines 1249..1254
src/tooltip/test/tooltip.spec.js on lines 1256..1261
src/tooltip/test/tooltip.spec.js on lines 1263..1268
src/tooltip/test/tooltip.spec.js on lines 1270..1275
src/tooltip/test/tooltip.spec.js on lines 1277..1282
src/tooltip/test/tooltip.spec.js on lines 1284..1289
src/tooltip/test/tooltip.spec.js on lines 1291..1296
src/tooltip/test/tooltip.spec.js on lines 1298..1303
src/tooltip/test/tooltip.spec.js on lines 1305..1310
src/tooltip/test/tooltip.spec.js on lines 1312..1317
src/tooltip/test/tooltip.spec.js on lines 1319..1324
src/tooltip/test/tooltip.spec.js on lines 1409..1414
src/tooltip/test/tooltip.spec.js on lines 1416..1421
src/tooltip/test/tooltip.spec.js on lines 1423..1428
src/tooltip/test/tooltip.spec.js on lines 1430..1435
src/tooltip/test/tooltip.spec.js on lines 1437..1442
src/tooltip/test/tooltip.spec.js on lines 1444..1449

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

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

      it('should shift left when positioning results in being outside of the viewport', function () {
        var bottom = viewportPlacements['options-placement-viewport-bottom'];

        expect(bottom.top).toBe('20px');
        expect(bottom.left).toBe('100px');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 17 other locations - About 1 hr to fix
src/tooltip/test/tooltip.spec.js on lines 1249..1254
src/tooltip/test/tooltip.spec.js on lines 1256..1261
src/tooltip/test/tooltip.spec.js on lines 1263..1268
src/tooltip/test/tooltip.spec.js on lines 1270..1275
src/tooltip/test/tooltip.spec.js on lines 1277..1282
src/tooltip/test/tooltip.spec.js on lines 1284..1289
src/tooltip/test/tooltip.spec.js on lines 1291..1296
src/tooltip/test/tooltip.spec.js on lines 1298..1303
src/tooltip/test/tooltip.spec.js on lines 1305..1310
src/tooltip/test/tooltip.spec.js on lines 1312..1317
src/tooltip/test/tooltip.spec.js on lines 1319..1324
src/tooltip/test/tooltip.spec.js on lines 1326..1331
src/tooltip/test/tooltip.spec.js on lines 1409..1414
src/tooltip/test/tooltip.spec.js on lines 1423..1428
src/tooltip/test/tooltip.spec.js on lines 1430..1435
src/tooltip/test/tooltip.spec.js on lines 1437..1442
src/tooltip/test/tooltip.spec.js on lines 1444..1449

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

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

      it('should position the tooltip to the right of the target when placement is `right`', function () {
        var placement = standardPlacements['options-placement-right'];

        expect(placement.top).toBe('-40px');
        expect(placement.left).toBe('20px');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 17 other locations - About 1 hr to fix
src/tooltip/test/tooltip.spec.js on lines 1249..1254
src/tooltip/test/tooltip.spec.js on lines 1263..1268
src/tooltip/test/tooltip.spec.js on lines 1270..1275
src/tooltip/test/tooltip.spec.js on lines 1277..1282
src/tooltip/test/tooltip.spec.js on lines 1284..1289
src/tooltip/test/tooltip.spec.js on lines 1291..1296
src/tooltip/test/tooltip.spec.js on lines 1298..1303
src/tooltip/test/tooltip.spec.js on lines 1305..1310
src/tooltip/test/tooltip.spec.js on lines 1312..1317
src/tooltip/test/tooltip.spec.js on lines 1319..1324
src/tooltip/test/tooltip.spec.js on lines 1326..1331
src/tooltip/test/tooltip.spec.js on lines 1409..1414
src/tooltip/test/tooltip.spec.js on lines 1416..1421
src/tooltip/test/tooltip.spec.js on lines 1423..1428
src/tooltip/test/tooltip.spec.js on lines 1430..1435
src/tooltip/test/tooltip.spec.js on lines 1437..1442
src/tooltip/test/tooltip.spec.js on lines 1444..1449

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

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

      it('should position the tooltip to the right-top of the target when placement is `right-top`', function () {
        var placement = standardPlacements['options-placement-exotic-right-top'];

        expect(placement.top).toBe('-80px');
        expect(placement.left).toBe('20px');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 17 other locations - About 1 hr to fix
src/tooltip/test/tooltip.spec.js on lines 1249..1254
src/tooltip/test/tooltip.spec.js on lines 1256..1261
src/tooltip/test/tooltip.spec.js on lines 1263..1268
src/tooltip/test/tooltip.spec.js on lines 1270..1275
src/tooltip/test/tooltip.spec.js on lines 1277..1282
src/tooltip/test/tooltip.spec.js on lines 1284..1289
src/tooltip/test/tooltip.spec.js on lines 1291..1296
src/tooltip/test/tooltip.spec.js on lines 1298..1303
src/tooltip/test/tooltip.spec.js on lines 1305..1310
src/tooltip/test/tooltip.spec.js on lines 1312..1317
src/tooltip/test/tooltip.spec.js on lines 1326..1331
src/tooltip/test/tooltip.spec.js on lines 1409..1414
src/tooltip/test/tooltip.spec.js on lines 1416..1421
src/tooltip/test/tooltip.spec.js on lines 1423..1428
src/tooltip/test/tooltip.spec.js on lines 1430..1435
src/tooltip/test/tooltip.spec.js on lines 1437..1442
src/tooltip/test/tooltip.spec.js on lines 1444..1449

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

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

      it('should position the tooltip to the bottom-right of the target when placement is `bottom-right`', function () {
        var placement = standardPlacements['options-placement-exotic-bottom-right'];

        expect(placement.top).toBe('20px');
        expect(placement.left).toBe('-180px');
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 17 other locations - About 1 hr to fix
src/tooltip/test/tooltip.spec.js on lines 1249..1254
src/tooltip/test/tooltip.spec.js on lines 1256..1261
src/tooltip/test/tooltip.spec.js on lines 1263..1268
src/tooltip/test/tooltip.spec.js on lines 1270..1275
src/tooltip/test/tooltip.spec.js on lines 1277..1282
src/tooltip/test/tooltip.spec.js on lines 1284..1289
src/tooltip/test/tooltip.spec.js on lines 1291..1296
src/tooltip/test/tooltip.spec.js on lines 1305..1310
src/tooltip/test/tooltip.spec.js on lines 1312..1317
src/tooltip/test/tooltip.spec.js on lines 1319..1324
src/tooltip/test/tooltip.spec.js on lines 1326..1331
src/tooltip/test/tooltip.spec.js on lines 1409..1414
src/tooltip/test/tooltip.spec.js on lines 1416..1421
src/tooltip/test/tooltip.spec.js on lines 1423..1428
src/tooltip/test/tooltip.spec.js on lines 1430..1435
src/tooltip/test/tooltip.spec.js on lines 1437..1442
src/tooltip/test/tooltip.spec.js on lines 1444..1449

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

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

    beforeEach(function() {
      elm = compileDirective('default');
      elmScope = angular.element(elm).scope().$$childTail;
      scope.$digest();
    });
Severity: Major
Found in src/tooltip/test/tooltip.spec.js and 1 other location - About 1 hr to fix
src/modal/test/modal.spec.js on lines 227..231

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

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