alexminichino/trawell

View on GitHub

Showing 303 of 303 total issues

Function Dropzone has a Cognitive Complexity of 1133 (exceeds 5 allowed). Consider refactoring.
Open

var Dropzone = function (_Emitter) {
  _inherits(Dropzone, _Emitter);

  _createClass(Dropzone, null, [{
    key: "initClass",
Severity: Minor
Found in src/main/resources/static/js/dropzone.js - About 3 wks 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

File jQuery.js has 6789 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * jQuery JavaScript Library v3.4.1
 * https://jquery.com/
 *
 * Includes Sizzle.js
Severity: Major
Found in src/main/resources/static/js/jQuery.js - About 2 wks to fix

    Function Dropzone has 1794 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var Dropzone = function (_Emitter) {
      _inherits(Dropzone, _Emitter);
    
      _createClass(Dropzone, null, [{
        key: "initClass",
    Severity: Major
    Found in src/main/resources/static/js/dropzone.js - About 1 wk to fix

      Function Sizzle has 1457 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              (function(window) {
      
                  var i,
                      support,
                      Expr,
      Severity: Major
      Found in src/main/resources/static/js/jQuery.js - About 1 wk to fix

        File dropzone.js has 2373 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        "use strict";
        
        var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
        
        function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
        Severity: Major
        Found in src/main/resources/static/js/dropzone.js - About 6 days to fix

          Function initClass has 354 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              value: function initClass() {
          
                // Exposing the emitter class, mainly for tests
                this.prototype.Emitter = Emitter;
          
          
          Severity: Major
          Found in src/main/resources/static/js/dropzone.js - About 1 day to fix

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

                value: function _finished(files, responseText, e) {
                  for (var _iterator31 = files, _isArray31 = true, _i33 = 0, _iterator31 = _isArray31 ? _iterator31 : _iterator31[Symbol.iterator]();;) {
                    var _ref30;
            
                    if (_isArray31) {
            Severity: Major
            Found in src/main/resources/static/js/dropzone.js and 1 other location - About 1 day to fix
            src/main/resources/static/js/dropzone.js on lines 2823..2850

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

            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

                value: function _errorProcessing(files, message, xhr) {
                  for (var _iterator32 = files, _isArray32 = true, _i34 = 0, _iterator32 = _isArray32 ? _iterator32 : _iterator32[Symbol.iterator]();;) {
                    var _ref31;
            
                    if (_isArray32) {
            Severity: Major
            Found in src/main/resources/static/js/dropzone.js and 1 other location - About 1 day to fix
            src/main/resources/static/js/dropzone.js on lines 2789..2816

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

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

                    ajax: function(url, options) {
            
                        // If url is an object, simulate pre-1.5 signature
                        if (typeof url === "object") {
                            options = url;
            Severity: Major
            Found in src/main/resources/static/js/jQuery.js - About 1 day to fix

              Function setDocument has 245 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          setDocument = Sizzle.setDocument = function(node) {
                              var hasCompare, subWindow,
                                  doc = node ? node.ownerDocument || node : preferredDoc;
              
                              // Return early if doc is invalid or already selected
              Severity: Major
              Found in src/main/resources/static/js/jQuery.js - About 1 day to fix

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

                   $(document).ready(function(){
                    $(".remove").click(function () {
                        var wrapper = $(".post").filter($(this).parents());
                        var id = $(this).attr("id");
                        var url = "/api/post/delete/"+id;
                Severity: Major
                Found in src/main/resources/static/js/removePost.js and 1 other location - About 1 day to fix
                src/main/resources/static/js/remove_itinerary.js on lines 5..30

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

                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

                $(document).ready(function(){
                    $(".remove").click(function () {
                        var wrapper = $("tr").filter($(this).parents());
                        var id = $(this).attr("id");
                        var url = "/api/itinerary/eliminate/"+id;
                Severity: Major
                Found in src/main/resources/static/js/remove_itinerary.js and 1 other location - About 1 day to fix
                src/main/resources/static/js/removePost.js on lines 7..31

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

                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

                        $.fn.serializeFormJSON = function () {
                    
                            var o = {headers: { 
                                'Accept': 'application/json',
                                'Content-Type': 'application/json' 
                Severity: Major
                Found in src/main/resources/static/js/modify_carsharing.js and 2 other locations - About 1 day to fix
                src/main/resources/static/js/modify_data.js on lines 12..30
                src/main/resources/static/js/send_carsharing.js on lines 12..30

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

                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

                    $.fn.serializeFormJSON = function () {
                
                        var o = {headers: { 
                            'Accept': 'application/json',
                            'Content-Type': 'application/json' 
                Severity: Major
                Found in src/main/resources/static/js/modify_data.js and 2 other locations - About 1 day to fix
                src/main/resources/static/js/modify_carsharing.js on lines 11..29
                src/main/resources/static/js/send_carsharing.js on lines 12..30

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

                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

                        $.fn.serializeFormJSON = function () {
                    
                            var o = {headers: { 
                                'Accept': 'application/json',
                                'Content-Type': 'application/json' 
                Severity: Major
                Found in src/main/resources/static/js/send_carsharing.js and 2 other locations - About 1 day to fix
                src/main/resources/static/js/modify_carsharing.js on lines 11..29
                src/main/resources/static/js/modify_data.js on lines 12..30

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

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

                        Deferred: function(func) {
                            var tuples = [
                
                                    // action, add listener, callbacks,
                                    // ... .then handlers, argument index, [final state]
                Severity: Major
                Found in src/main/resources/static/js/jQuery.js - About 7 hrs to fix

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

                  var Emitter = function () {
                    function Emitter() {
                      _classCallCheck(this, Emitter);
                    }
                  
                  
                  Severity: Minor
                  Found in src/main/resources/static/js/dropzone.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

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

                  function remove(x) {
                      var wrapper = $("tr").filter($(x).parents());
                      var id = x.id;
                      var url = "/api/document/eliminate/"+id;
                  
                  
                  Severity: Major
                  Found in src/main/resources/static/js/removeDocument.js and 1 other location - About 6 hrs to fix
                  src/main/resources/static/js/removeGroup.js on lines 7..29

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

                  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 remove(x) {
                      var wrapper = $("tr").filter($(x).parents());
                      var id = x.id;
                      var url = "/api/group/eliminate/" + id;
                      custom_alert("Message","are you sure you want to eliminate this Group?")
                  Severity: Major
                  Found in src/main/resources/static/js/removeGroup.js and 1 other location - About 6 hrs to fix
                  src/main/resources/static/js/removeDocument.js on lines 7..30

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

                  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 getElements has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
                  Open

                  Dropzone.getElements = function (els, name) {
                    var el = void 0,
                        elements = void 0;
                    if (els instanceof Array) {
                      elements = [];
                  Severity: Minor
                  Found in src/main/resources/static/js/dropzone.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

                  Severity
                  Category
                  Status
                  Source
                  Language