oglimmer/ggo

View on GitHub

Showing 102 of 183 total issues

Function AtmosphereRequest has 2082 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        AtmosphereRequest: function (options) {

            /**
             * {Object} Request parameters.
             *
Severity: Major
Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 1 wk to fix

    File atmosphere-javascript-2.3.2.js has 2578 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
     * Copyright 2015 Async-IO.org
     *
     * Licensed under the Apache License, Version 2.0 (the "License");
     * you may not use this file except in compliance with the License.
    Severity: Major
    Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 1 wk to fix

      File watch-1.3.0.js has 627 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /**
       * THIS VERSION 1.3
       * 
       * DEVELOPED BY
       * GIL LOPES BUENO
      Severity: Major
      Found in web/src/main/webapp/js/lib/watch-1.3.0.js - About 1 day to fix

        Function _executeRequest has 224 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    function _executeRequest(request) {
                        var rq = _request;
                        if ((request != null) || (typeof (request) !== 'undefined')) {
                            rq = request;
                        }
        Severity: Major
        Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 1 day to fix

          Method build has 183 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public TutorialDelegateBasePhase build(Game game) {
          
                  return new Builder(game)
          
                          /* Some texts at the beginning */

            Function _executeWebSocket has 172 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        function _executeWebSocket(webSocketOpened) {
            
                            _response.transport = "websocket";
            
                            var location = _buildWebSocketUrl(_request.url);
            Severity: Major
            Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 6 hrs to fix

              Function _local has 167 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          function _local(request) {
                              var trace, connector, orphan, name = "atmosphere-" + request.url, connectors = {
                                  storage: function () {
                                      function onstorage(event) {
                                          if (event.key === name && event.newValue) {
              Severity: Major
              Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 6 hrs to fix

                Function onreadystatechange has 126 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                                    ajaxRequest.onreadystatechange = function () {
                                        _debug("ajaxRequest.onreadystatechange, new state: " + ajaxRequest.readyState);
                                        if (_abortingConnection) {
                                            _debug("onreadystatechange has been ignored due to _abortingConnection flag");
                                            return;
                Severity: Major
                Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 5 hrs to fix

                  File TutorialStepFactory.java has 367 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  package de.oglimmer.ggo.logic.phase.tutorial;
                  
                  import java.lang.reflect.InvocationTargetException;
                  import java.util.function.Consumer;
                  
                  

                    Function share has 117 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                function share() {
                                    var storageService, name = "atmosphere-" + _request.url, servers = {
                                        // Powered by the storage event and the localStorage
                                        // http://www.w3.org/TR/webstorage/#event-storage
                                        storage: function () {
                    Severity: Major
                    Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 4 hrs to fix

                      Function _configureIE has 106 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  function _configureIE(request) {
                                      var rq = _request;
                                      if ((request != null) && (typeof (request) !== 'undefined')) {
                                          rq = request;
                                      }
                      Severity: Major
                      Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 4 hrs to fix

                        Function _jsonp has 102 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                    function _jsonp(request) {
                                        // When CORS is enabled, make sure we force the proper transport.
                                        request.transport = "jsonp";
                        
                                        var rq = _request, script;
                        Severity: Major
                        Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 4 hrs to fix

                          Function _executeSSE has 100 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                      function _executeSSE(sseOpened) {
                          
                                          _response.transport = "sse";
                          
                                          var location = _buildSSEUrl();
                          Severity: Major
                          Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 4 hrs to fix

                            Function _configureXDR has 93 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                        function _configureXDR(request) {
                                            var rq = _request;
                                            if ((request != null) && (typeof (request) !== 'undefined')) {
                                                rq = request;
                                            }
                            Severity: Major
                            Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 3 hrs to fix

                              Function open has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                                  open: function () {
                                                      var callback = "atmosphere" + (++guid);
                              
                                                      function _reconnectOnFailure() {
                                                          rq.lastIndex = 0;
                              Severity: Major
                              Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 3 hrs to fix

                                Method adjacent has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public static boolean adjacent(Field a, Field b) {
                                        int thisX = (int) a.getPos().getX();
                                        int thisY = (int) a.getPos().getY();
                                        int fx = (int) b.getPos().getX();
                                        int fy = (int) b.getPos().getY();
                                Severity: Minor
                                Found in core/src/main/java/de/oglimmer/ggo/logic/util/FieldUtil.java - About 3 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 open has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                                    open: function () {
                                                        var iframe = doc.createElement("iframe");
                                
                                                        url = _attachHeaders(rq);
                                                        if (rq.data !== '') {
                                Severity: Major
                                Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 3 hrs to fix

                                  Function defineWatcher has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      var defineWatcher = function (obj, prop, watcher, level) {
                                          var newWatcher = false;
                                          var isArr = isArray(obj);
                                          
                                          if (!obj.watchers) {
                                  Severity: Major
                                  Found in web/src/main/webapp/js/lib/watch-1.3.0.js - About 3 hrs to fix

                                    Function _f has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                                function _f(response, f) {
                                                    switch (response.state) {
                                                        case "messageReceived":
                                                            _debug("Firing onMessage");
                                                            _requestCount = 0;
                                    Severity: Major
                                    Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 2 hrs to fix

                                      Function onclose has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                                      _websocket.onclose = function (message) {
                                                          _debug("websocket.onclose");
                                                          clearTimeout(_request.id);
                                                          if (_response.state === 'closed')
                                                              return;
                                      Severity: Major
                                      Found in web/src/main/webapp/js/lib/atmosphere-javascript-2.3.2.js - About 2 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language