laboiteproject/lenuage

View on GitHub

Showing 384 of 384 total issues

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

@pytest.mark.skip(reason="outdated test")
def test_crypto_found_eur(app, requests_mocker, settings):
    """Get Ethereum price in euros"""
    app.cryptocurrency = 'ethereum'
    app.currency = 'EUR'
Severity: Major
Found in laboite/apps/cryptocurrency/tests.py and 1 other location - About 1 day to fix
laboite/apps/cryptocurrency/tests.py on lines 115..146

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

@pytest.mark.skip(reason="outdated test")
def test_crypto_found_usd(app, requests_mocker, settings):
    """Get Bitcoin price in dollars"""
    app.cryptocurrency = 'bitcoin'
    app.currency = 'USD'
Severity: Major
Found in laboite/apps/cryptocurrency/tests.py and 1 other location - About 1 day to fix
laboite/apps/cryptocurrency/tests.py on lines 153..185

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

Function 8 has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
Open

},{}],8:[function(require,module,exports){
/* ========================================================================
 * Bootstrap: dropdown.js v3.3.7
 * http://getbootstrap.com/javascript/#dropdowns
 * ========================================================================
Severity: Minor
Found in static/dist/js/site-70bd78197e.js - About 1 day to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function 7 has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
Open

},{}],7:[function(require,module,exports){
/* ========================================================================
 * Bootstrap: collapse.js v3.3.7
 * http://getbootstrap.com/javascript/#collapse
 * ========================================================================
Severity: Minor
Found in static/dist/js/site-70bd78197e.js - About 6 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function 6 has 168 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{}],6:[function(require,module,exports){
/* ========================================================================
 * Bootstrap: carousel.js v3.3.7
 * http://getbootstrap.com/javascript/#carousel
 * ========================================================================
Severity: Major
Found in static/dist/js/site-70bd78197e.js - About 6 hrs to fix

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

    @pytest.mark.django_db
    def test_no_data_successful_request_with_failure(app, requests_mocker, settings):
        expected_data = {
            'width': 32,
            'height': 8,
    Severity: Major
    Found in laboite/apps/metro/tests.py and 1 other location - About 6 hrs to fix
    laboite/apps/metro/tests.py on lines 117..146

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

    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

    @pytest.mark.django_db
    def test_successful_request_no_failure(app, requests_mocker, settings):
        expected_data = {
            'width': 32,
            'height': 8,
    Severity: Major
    Found in laboite/apps/metro/tests.py and 1 other location - About 6 hrs to fix
    laboite/apps/metro/tests.py on lines 149..178

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

    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

    Severity: Major
    Found in laboite/apps/data/migrations/0005_auto_20181115_1021.py and 1 other location - About 5 hrs to fix
    laboite/apps/data/migrations/0006_auto_20190210_2136.py on lines 0..21

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

    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

    Severity: Major
    Found in laboite/apps/data/migrations/0006_auto_20190210_2136.py and 1 other location - About 5 hrs to fix
    laboite/apps/data/migrations/0005_auto_20181115_1021.py on lines 0..21

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

    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 7 has 141 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    },{}],7:[function(require,module,exports){
    /* ========================================================================
     * Bootstrap: collapse.js v3.3.7
     * http://getbootstrap.com/javascript/#collapse
     * ========================================================================
    Severity: Major
    Found in static/dist/js/site-70bd78197e.js - About 5 hrs to fix

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

        function Plugin(option) {
          return this.each(function () {
            var $this   = $(this)
            var data    = $this.data('bs.popover')
            var options = typeof option == 'object' && option
      Severity: Major
      Found in static/dist/js/site-70bd78197e.js and 1 other location - About 5 hrs to fix
      static/dist/js/site-70bd78197e.js on lines 3084..3094

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

      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

        function Plugin(option) {
          return this.each(function () {
            var $this   = $(this)
            var data    = $this.data('bs.tooltip')
            var options = typeof option == 'object' && option
      Severity: Major
      Found in static/dist/js/site-70bd78197e.js and 1 other location - About 5 hrs to fix
      static/dist/js/site-70bd78197e.js on lines 2231..2241

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

      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

      Consider simplifying this complex logical expression.
      Open

                  if ( event.pageX == null && original.clientX != null ) {
                      eventDoc = event.target.ownerDocument || document;
                      doc = eventDoc.documentElement;
                      body = eventDoc.body;
      
      
      Severity: Critical
      Found in static/dist/js/site-70bd78197e.js - About 5 hrs to fix

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

            }, {
              key: 'onColor',
              value: function onColor(value) {
                if (typeof value === 'undefined') {
                  return this.options.onColor;
        Severity: Major
        Found in static/dist/js/site-70bd78197e.js and 1 other location - About 5 hrs to fix
        static/dist/js/site-70bd78197e.js on lines 324..337

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

        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

            }, {
              key: 'offColor',
              value: function offColor(value) {
                if (typeof value === 'undefined') {
                  return this.options.offColor;
        Severity: Major
        Found in static/dist/js/site-70bd78197e.js and 1 other location - About 5 hrs to fix
        static/dist/js/site-70bd78197e.js on lines 311..324

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

        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 Callbacks has 121 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        jQuery.Callbacks = function( options ) {
        
            // Convert options from String-formatted to Object-formatted if needed
            // (we check in cache first)
            options = typeof options === "string" ?
        Severity: Major
        Found in static/dist/js/site-70bd78197e.js - About 4 hrs to fix

          Function 11 has 119 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          },{}],11:[function(require,module,exports){
          /* ========================================================================
           * Bootstrap: scrollspy.js v3.3.7
           * http://getbootstrap.com/javascript/#scrollspy
           * ========================================================================
          Severity: Major
          Found in static/dist/js/site-70bd78197e.js - About 4 hrs to fix

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

                def get_context_data(self, **kwargs):
                    context = super(TileAppDeleteView, self).get_context_data(**kwargs)
                    boite = get_object_or_404(Boite, pk=self.kwargs.get('boite_pk'), user=self.request.user)
                    context['boite'] = boite
                    context['boite_id'] = self.kwargs.get('boite_pk')
            Severity: Major
            Found in boites/views.py and 4 other locations - About 4 hrs to fix
            boites/views.py on lines 178..184
            boites/views.py on lines 194..199
            boites/views.py on lines 248..253
            boites/views.py on lines 339..345

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

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

                def get_context_data(self, **kwargs):
                    context = super(TileDeleteView, self).get_context_data(**kwargs)
                    boite = get_object_or_404(Boite, pk=self.kwargs.get('boite_pk'), user=self.request.user)
                    context['boite'] = boite
                    context['boite_id'] = self.kwargs.get('boite_pk')
            Severity: Major
            Found in boites/views.py and 4 other locations - About 4 hrs to fix
            boites/views.py on lines 178..184
            boites/views.py on lines 194..199
            boites/views.py on lines 248..253
            boites/views.py on lines 385..391

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

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

                def get_context_data(self, **kwargs):
                    context = super(PushButtonUpdateView, self).get_context_data(**kwargs)
                    boite = get_object_or_404(Boite, pk=self.kwargs.get('pk'), user=self.request.user)
                    context['boite'] = boite
                    context['boite_id'] = self.kwargs.get('pk')
            Severity: Major
            Found in boites/views.py and 4 other locations - About 4 hrs to fix
            boites/views.py on lines 194..199
            boites/views.py on lines 248..253
            boites/views.py on lines 339..345
            boites/views.py on lines 385..391

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

            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