nemesiscodex/openfonacide

View on GitHub

Showing 970 of 970 total issues

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

        settings          = ( $.isPlainObject(parameters) )
          ? $.extend(true, {}, $.fn.state.settings, parameters)
          : $.extend({}, $.fn.state.settings),
Severity: Major
Found in static/components/state.js and 14 other locations - About 1 hr to fix
static/components/accordion.js on lines 38..40
static/components/api.js on lines 37..39
static/components/dimmer.js on lines 33..35
static/components/dropdown.js on lines 36..38
static/components/modal.js on lines 44..46
static/components/nag.js on lines 32..34
static/components/popup.js on lines 36..38
static/components/progress.js on lines 35..37
static/components/rating.js on lines 32..34
static/components/sidebar.js on lines 45..47
static/components/sticky.js on lines 33..35
static/components/tab.js on lines 24..26
static/components/video.js on lines 42..44
static/components/visibility.js on lines 33..35

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

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

        settings        = ( $.isPlainObject(parameters) )
          ? $.extend(true, {}, $.fn.video.settings, parameters)
          : $.extend({}, $.fn.video.settings),
Severity: Major
Found in static/components/video.js and 14 other locations - About 1 hr to fix
static/components/accordion.js on lines 38..40
static/components/api.js on lines 37..39
static/components/dimmer.js on lines 33..35
static/components/dropdown.js on lines 36..38
static/components/modal.js on lines 44..46
static/components/nag.js on lines 32..34
static/components/popup.js on lines 36..38
static/components/progress.js on lines 35..37
static/components/rating.js on lines 32..34
static/components/sidebar.js on lines 45..47
static/components/state.js on lines 35..37
static/components/sticky.js on lines 33..35
static/components/tab.js on lines 24..26
static/components/visibility.js on lines 33..35

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

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

        settings    = ( $.isPlainObject(parameters) )
          ? $.extend(true, {}, $.fn.modal.settings, parameters)
          : $.extend({}, $.fn.modal.settings),
Severity: Major
Found in static/components/modal.js and 14 other locations - About 1 hr to fix
static/components/accordion.js on lines 38..40
static/components/api.js on lines 37..39
static/components/dimmer.js on lines 33..35
static/components/dropdown.js on lines 36..38
static/components/nag.js on lines 32..34
static/components/popup.js on lines 36..38
static/components/progress.js on lines 35..37
static/components/rating.js on lines 32..34
static/components/sidebar.js on lines 45..47
static/components/state.js on lines 35..37
static/components/sticky.js on lines 33..35
static/components/tab.js on lines 24..26
static/components/video.js on lines 42..44
static/components/visibility.js on lines 33..35

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

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

        settings        = ( $.isPlainObject(parameters) )
          ? $.extend(true, {}, $.fn.sidebar.settings, parameters)
          : $.extend({}, $.fn.sidebar.settings),
Severity: Major
Found in static/components/sidebar.js and 14 other locations - About 1 hr to fix
static/components/accordion.js on lines 38..40
static/components/api.js on lines 37..39
static/components/dimmer.js on lines 33..35
static/components/dropdown.js on lines 36..38
static/components/modal.js on lines 44..46
static/components/nag.js on lines 32..34
static/components/popup.js on lines 36..38
static/components/progress.js on lines 35..37
static/components/rating.js on lines 32..34
static/components/state.js on lines 35..37
static/components/sticky.js on lines 33..35
static/components/tab.js on lines 24..26
static/components/video.js on lines 42..44
static/components/visibility.js on lines 33..35

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

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

        settings        = ( $.isPlainObject(parameters) )
          ? $.extend(true, {}, $.fn.rating.settings, parameters)
          : $.extend({}, $.fn.rating.settings),
Severity: Major
Found in static/components/rating.js and 14 other locations - About 1 hr to fix
static/components/accordion.js on lines 38..40
static/components/api.js on lines 37..39
static/components/dimmer.js on lines 33..35
static/components/dropdown.js on lines 36..38
static/components/modal.js on lines 44..46
static/components/nag.js on lines 32..34
static/components/popup.js on lines 36..38
static/components/progress.js on lines 35..37
static/components/sidebar.js on lines 45..47
static/components/state.js on lines 35..37
static/components/sticky.js on lines 33..35
static/components/tab.js on lines 24..26
static/components/video.js on lines 42..44
static/components/visibility.js on lines 33..35

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

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

        settings        = ( $.isPlainObject(parameters) )
          ? $.extend(true, {}, $.fn.dimmer.settings, parameters)
          : $.extend({}, $.fn.dimmer.settings),
Severity: Major
Found in static/components/dimmer.js and 14 other locations - About 1 hr to fix
static/components/accordion.js on lines 38..40
static/components/api.js on lines 37..39
static/components/dropdown.js on lines 36..38
static/components/modal.js on lines 44..46
static/components/nag.js on lines 32..34
static/components/popup.js on lines 36..38
static/components/progress.js on lines 35..37
static/components/rating.js on lines 32..34
static/components/sidebar.js on lines 45..47
static/components/state.js on lines 35..37
static/components/sticky.js on lines 33..35
static/components/tab.js on lines 24..26
static/components/video.js on lines 42..44
static/components/visibility.js on lines 33..35

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

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

                                if ($scope.filtroArray.length > 0) {
                                    $scope.actualizar(function (array) {
                                        return array.filter(originalFilterFunction)
                                    });
                                } else {
Severity: Major
Found in static/js/frontend.MapController.js and 1 other location - About 1 hr to fix
static/js/frontend.MapController.js on lines 350..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 65.

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

                                if ($scope.filtroArray.length > 0) {
                                    $scope.actualizar(function (array) {
                                        return array.filter(originalFilterFunction)
                                    });
                                } else {
Severity: Major
Found in static/js/frontend.MapController.js and 1 other location - About 1 hr to fix
static/js/frontend.MapController.js on lines 331..338

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

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

            error: function(xhr, status, httpMessage) {
              var
                errorMessage = (settings.error[status] !== undefined)
                  ? settings.error[status]
                  : httpMessage,
Severity: Minor
Found in static/components/api.js - About 1 hr to fix

    Function argmax has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        argmax : kwargs((function () {
            function withAxis(data, source, offsetStride, axisSize, stride) {
                var cursor = 0;
                for (var offset = 0; offset < this._size; offset+=offsetStride) {
                    for (var i = 0; i < stride; i++) {
    Severity: Minor
    Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

      Function _mercator has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function _mercator() {
              var radians = Math.PI / 180;
              var scale = 500;
              var translate = [480, 250];
      
      
      Severity: Minor
      Found in static/js/dncp/util/projection/mercator.js - About 1 hr to fix

        Function repeat has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            repeat : kwargs(function (repeats, axis, out) {
                var shape;
                // flattened input array
                if (typeof(axis) === 'undefined') {
                    shape = [this._size];
        Severity: Minor
        Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

          Function argmin has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              argmin : kwargs((function () {
                  function withAxis(data, source, offsetStride, axisSize, stride) {
                      var cursor = 0;
                      for (var offset = 0; offset < this._size; offset+=offsetStride) {
                          for (var i = 0; i < stride; i++) {
          Severity: Minor
          Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

            Function ribbon has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function ribbon(zr, oldShape, newShape, duration, easing) {
                    if (!oldShape) {        // add
                        oldShape = {
                            style : {
                                source0 : 0,
            Severity: Minor
            Found in static/js/dncp/util/ecAnimation.js - About 1 hr to fix

              Function reset has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      reset: function() {
                        $field
                          .each(function () {
                            var
                              $field       = $(this),
              Severity: Minor
              Found in static/components/form.js - About 1 hr to fix

                Function loadLiquidFillGauge has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                function loadLiquidFillGauge(elementId, value, config) {
                    if(config == null) config = liquidFillGaugeDefaultSettings();
                
                    var gauge = d3.select("#" + elementId);
                    var radius = Math.min(parseInt(gauge.style("width")), parseInt(gauge.style("height")))/2;
                Severity: Minor
                Found in static/js/liquidFillGauge.js - About 1 hr 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 setPiece has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        var setPiece = function (axis, offset) {
                            var range = ranges[axis];
                            var stride = strides[axis];
                            if (axis < len-1) {
                                if (range[2] > 0) {
                Severity: Minor
                Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

                  Function estado_de_obra has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  def estado_de_obra(request):
                      if request.method != 'POST':
                          return JsonResponse({'error': 'Método inválido.'}, status=405)
                  
                      estado = request.POST.get('estado')
                  Severity: Minor
                  Found in openfonacide/views.py - About 1 hr to fix

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

                            zr.animate(newShape.id, 'style')
                                .when(
                                    duration,
                                    { y: newY }
                                )
                    Severity: Major
                    Found in static/js/dncp/util/ecAnimation.js and 2 other locations - About 1 hr to fix
                    static/js/dncp/util/ecAnimation.js on lines 240..250
                    static/js/dncp/util/ecAnimation.js on lines 450..460

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

                    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

                                zr.animate(newShape.id, 'style')
                                    .when(
                                        duration,
                                        {
                                            r0 : r0
                    Severity: Major
                    Found in static/js/dncp/util/ecAnimation.js and 2 other locations - About 1 hr to fix
                    static/js/dncp/util/ecAnimation.js on lines 183..191
                    static/js/dncp/util/ecAnimation.js on lines 450..460

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

                    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