twbs/bootstrap

View on GitHub

Showing 778 of 778 total issues

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

    it('should add the active class to the correct element', done => {
      fixtureEl.innerHTML = [
        '<nav class="navbar">',
        '  <ul class="nav">',
        '    <li class="nav-item"><a class="nav-link" id="a-1" href="#div-1">div 1</a></li>',
Severity: Major
Found in js/src/scrollspy/scrollspy.spec.js and 2 other locations - About 7 hrs to fix
js/src/scrollspy/scrollspy.spec.js on lines 251..289
js/src/scrollspy/scrollspy.spec.js on lines 291..329

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

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

  function _objectSpread2(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = arguments[i] != null ? arguments[i] : {};

      if (i % 2) {
Severity: Major
Found in js/dist/dropdown.js and 7 other locations - About 7 hrs to fix
js/dist/carousel.js on lines 62..80
js/dist/collapse.js on lines 62..80
js/dist/dom/manipulator.js on lines 41..59
js/dist/modal.js on lines 62..80
js/dist/scrollspy.js on lines 62..80
js/dist/toast.js on lines 61..79
js/dist/tooltip.js on lines 63..81

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

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

  function _objectSpread2(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = arguments[i] != null ? arguments[i] : {};

      if (i % 2) {
Severity: Major
Found in js/dist/scrollspy.js and 7 other locations - About 7 hrs to fix
js/dist/carousel.js on lines 62..80
js/dist/collapse.js on lines 62..80
js/dist/dom/manipulator.js on lines 41..59
js/dist/dropdown.js on lines 63..81
js/dist/modal.js on lines 62..80
js/dist/toast.js on lines 61..79
js/dist/tooltip.js on lines 63..81

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

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

  function _objectSpread2(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = arguments[i] != null ? arguments[i] : {};

      if (i % 2) {
Severity: Major
Found in js/dist/modal.js and 7 other locations - About 7 hrs to fix
js/dist/carousel.js on lines 62..80
js/dist/collapse.js on lines 62..80
js/dist/dom/manipulator.js on lines 41..59
js/dist/dropdown.js on lines 63..81
js/dist/scrollspy.js on lines 62..80
js/dist/toast.js on lines 61..79
js/dist/tooltip.js on lines 63..81

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

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

  function _objectSpread2(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = arguments[i] != null ? arguments[i] : {};

      if (i % 2) {
Severity: Major
Found in js/dist/carousel.js and 7 other locations - About 7 hrs to fix
js/dist/collapse.js on lines 62..80
js/dist/dom/manipulator.js on lines 41..59
js/dist/dropdown.js on lines 63..81
js/dist/modal.js on lines 62..80
js/dist/scrollspy.js on lines 62..80
js/dist/toast.js on lines 61..79
js/dist/tooltip.js on lines 63..81

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

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 add the active class to the correct element (list-group markup)', done => {
      fixtureEl.innerHTML = [
        '<nav class="navbar">',
        '  <div class="list-group">',
        '    <a class="list-group-item" id="a-1" href="#div-1">div 1</a>',
Severity: Major
Found in js/src/scrollspy/scrollspy.spec.js and 2 other locations - About 7 hrs to fix
js/src/scrollspy/scrollspy.spec.js on lines 211..249
js/src/scrollspy/scrollspy.spec.js on lines 251..289

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

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 add the active class to the correct element (nav markup)', done => {
      fixtureEl.innerHTML = [
        '<nav class="navbar">',
        '  <nav class="nav">',
        '    <a class="nav-link" id="a-1" href="#div-1">div 1</a>',
Severity: Major
Found in js/src/scrollspy/scrollspy.spec.js and 2 other locations - About 7 hrs to fix
js/src/scrollspy/scrollspy.spec.js on lines 211..249
js/src/scrollspy/scrollspy.spec.js on lines 291..329

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

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

File dropdown.js has 487 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
  * Bootstrap dropdown.js v4.3.1 (https://getbootstrap.com/)
  * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  */
Severity: Minor
Found in js/dist/dropdown.js - About 7 hrs to fix

    File carousel.js has 481 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * --------------------------------------------------------------------------
     * Bootstrap (v4.3.1): carousel.js
     * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
     * --------------------------------------------------------------------------
    Severity: Minor
    Found in js/src/carousel/carousel.js - About 7 hrs to fix

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

      import Tab from './tab'
      
      /** Test helpers */
      import { getFixture, clearFixture, jQueryMock } from '../../tests/helpers/fixture'
      
      
      Severity: Minor
      Found in js/src/tab/tab.spec.js - About 7 hrs to fix

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

            it('should show a collapsed element', done => {
              fixtureEl.innerHTML = '<div class="collapse" style="height: 0px;"></div>'
        
              const collapseEl = fixtureEl.querySelector('div')
              const collapse = new Collapse(collapseEl, {
        Severity: Major
        Found in js/src/collapse/collapse.spec.js and 1 other location - About 7 hrs to fix
        js/src/collapse/collapse.spec.js on lines 210..228

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

        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 show a collapsed element on width', done => {
              fixtureEl.innerHTML = '<div class="collapse width" style="width: 0px;"></div>'
        
              const collapseEl = fixtureEl.querySelector('div')
              const collapse = new Collapse(collapseEl, {
        Severity: Major
        Found in js/src/collapse/collapse.spec.js and 1 other location - About 7 hrs to fix
        js/src/collapse/collapse.spec.js on lines 190..208

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

        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 hide a dropdown if the element is disabled', done => {
              fixtureEl.innerHTML = [
                '<div class="dropdown">',
                '  <button disabled href="#" class="btn dropdown-toggle" data-toggle="dropdown">Dropdown</button>',
                '  <div class="dropdown-menu show">',
        Severity: Major
        Found in js/src/dropdown/dropdown.spec.js and 1 other location - About 7 hrs to fix
        js/src/dropdown/dropdown.spec.js on lines 735..760

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

        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 hide a dropdown if the element contains .disabled', done => {
              fixtureEl.innerHTML = [
                '<div class="dropdown">',
                '  <button href="#" class="btn dropdown-toggle disabled" data-toggle="dropdown">Dropdown</button>',
                '  <div class="dropdown-menu show">',
        Severity: Major
        Found in js/src/dropdown/dropdown.spec.js and 1 other location - About 7 hrs to fix
        js/src/dropdown/dropdown.spec.js on lines 708..733

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

        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

        Function ScrollSpy has 176 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function () {
            function ScrollSpy(element, config) {
              var _this = this;
        
              this._element = element;
        Severity: Major
        Found in js/dist/scrollspy.js - About 7 hrs to fix

          File collapse.js has 456 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*!
            * Bootstrap collapse.js v4.3.1 (https://getbootstrap.com/)
            * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
            * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
            */
          Severity: Minor
          Found in js/dist/collapse.js - About 6 hrs to fix

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

                it('should not fire hidden when hide is prevented', done => {
                  fixtureEl.innerHTML = '<div class="collapse show"></div>'
            
                  const collapseEl = fixtureEl.querySelector('div')
                  const collapse = new Collapse(collapseEl, {
            Severity: Major
            Found in js/src/collapse/collapse.spec.js and 1 other location - About 6 hrs to fix
            js/src/collapse/collapse.spec.js on lines 255..280

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

            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 fire shown when show is prevented', done => {
                  fixtureEl.innerHTML = '<div class="collapse"></div>'
            
                  const collapseEl = fixtureEl.querySelector('div')
                  const collapse = new Collapse(collapseEl, {
            Severity: Major
            Found in js/src/collapse/collapse.spec.js and 1 other location - About 6 hrs to fix
            js/src/collapse/collapse.spec.js on lines 332..357

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

            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

            File modal.js has 446 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /**
             * --------------------------------------------------------------------------
             * Bootstrap (v4.3.1): modal.js
             * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
             * --------------------------------------------------------------------------
            Severity: Minor
            Found in js/src/modal/modal.js - About 6 hrs to fix

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

                var getTransitionDurationFromElement = function getTransitionDurationFromElement(element) {
                  if (!element) {
                    return 0;
                  } // Get transition-duration of the element
              
              
              Severity: Major
              Found in js/dist/carousel.js and 6 other locations - About 6 hrs to fix
              js/dist/alert.js on lines 57..78
              js/dist/collapse.js on lines 121..142
              js/dist/modal.js on lines 111..132
              js/dist/tab.js on lines 57..78
              js/dist/toast.js on lines 94..115
              js/dist/tooltip.js on lines 112..133

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

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

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

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

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

              Refactorings

              Further Reading

              Severity
              Category
              Status
              Source
              Language