Thibau/datalift-sdmxdatacube

View on GitHub

Showing 17 of 55 total issues

File bootstrap-2.3.0.min.js has 1508 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* ===================================================
 * bootstrap-transition.js v2.3.0
 * http://twitter.github.com/bootstrap/javascript.html#transitions
 * ===================================================
 * Copyright 2012 Twitter, Inc.
Severity: Major
Found in sdmxdatacube/src/web/public/static/js/libs/bootstrap-2.3.0.min.js - About 4 days to fix

    Method validate has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
    Open

        private MessageTransporter validate(String project, String source,
                String dest_graph_uri, String dest_title, boolean vizualisation) {
    
            MessageTransporter transporter = new MessageTransporter();
    
    

    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

    Method validate has 83 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private MessageTransporter validate(String project, String source,
                String dest_graph_uri, String dest_title, boolean vizualisation) {
    
            MessageTransporter transporter = new MessageTransporter();
    
    

      Method isSdmx has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

          public static boolean isSdmx(InputStream is) throws IOException {
              BufferedReader in = new BufferedReader(new InputStreamReader(is));
              String line = null;
              boolean comment = false;
              int max_line = 100;

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

        , slide: function (type, next) {
            var $active = this.$element.find('.item.active')
              , $next = next || $active[type]()
              , isCycling = this.interval
              , direction = type == 'next' ? 'left' : 'right'
      Severity: Minor
      Found in sdmxdatacube/src/web/public/static/js/libs/bootstrap-2.3.0.min.js - About 1 hr to fix

        Function show has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          , show: function () {
              var $tip
                , pos
                , actualWidth
                , actualHeight
        Severity: Minor
        Found in sdmxdatacube/src/web/public/static/js/libs/bootstrap-2.3.0.min.js - About 1 hr to fix

          Function State has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            var State = function () {
              var self = this;
          
              // Those are the states of the converter at a given time.
              self.isProcessing  = ko.observable(false);
          Severity: Minor
          Found in sdmxdatacube/src/web/public/static/js/models/State.js - About 1 hr to fix

            Function ConverterViewModel has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              var ConverterViewModel = function (rawSources, viewResults) {
                var self = this;
            
            
                self.rawSources    = rawSources;
            Severity: Minor
            Found in sdmxdatacube/src/web/public/static/js/viewmodels/converter.js - About 1 hr to fix

              Method doSubmit has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  @POST
                  @Path("/")
                  @Consumes(MediaTypes.APPLICATION_FORM_URLENCODED)
                  @Produces(MediaTypes.TEXT_PLAIN)
                  public Response doSubmit(@FormParam("project") String project,

                Function Source has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  var Source = function (parent, project, title, uri, uriPattern, creator, created) {
                    var self = this;
                
                    // Parent is a JS object with properties title and uri.
                    // Project is also a JS object with properties title and uri.
                Severity: Minor
                Found in sdmxdatacube/src/web/public/static/js/models/Source.js - About 1 hr to fix

                  Function update has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      update: function (element, valueAccessor) {
                        //var value = ko.utils.unwrapObservable(valueAccessor());
                  
                        var values = [
                          {type: "Schème", value: 'http://', name: "http://", desc: "Cette partie de l'URI spécifie le protocole utilisé pour accéder à la ressource."},
                  Severity: Minor
                  Found in sdmxdatacube/src/web/public/static/js/extends/handlers.js - About 1 hr to fix

                    Function applyPlacement has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      , applyPlacement: function(offset, placement){
                          var $tip = this.tip()
                            , width = $tip[0].offsetWidth
                            , height = $tip[0].offsetHeight
                            , actualWidth
                    Severity: Minor
                    Found in sdmxdatacube/src/web/public/static/js/libs/bootstrap-2.3.0.min.js - About 1 hr to fix

                      Function keydown has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        , keydown: function (e) {
                            var $this
                              , $items
                              , $active
                              , $parent
                      Severity: Minor
                      Found in sdmxdatacube/src/web/public/static/js/libs/bootstrap-2.3.0.min.js - About 1 hr to fix

                        Function Source has 7 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                          var Source = function (parent, project, title, uri, uriPattern, creator, created) {
                        Severity: Major
                        Found in sdmxdatacube/src/web/public/static/js/models/Source.js - About 50 mins to fix

                          Method doSubmit has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              public Response doSubmit(@FormParam("project") String project,
                                      @FormParam("source") String source,
                                      @FormParam("dest_title") String dest_title,
                                      @FormParam("dest_graph_uri") String dest_graph_uri,
                                      @FormParam("vizualisation") boolean vizualisation)

                            Method validate has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                private MessageTransporter validate(String project, String source,
                                        String dest_graph_uri, String dest_title, boolean vizualisation) {

                              Method doValidate has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  public Response doValidate(@FormParam("project") String project,
                                          @FormParam("source") String source,
                                          @FormParam("dest_title") String dest_title,
                                          @FormParam("dest_graph_uri") String dest_graph_uri,
                                          @FormParam("vizualisation") boolean vizualisation)
                                Severity
                                Category
                                Status
                                Source
                                Language