BitPrepared/dreamland-portal

View on GitHub

Showing 46 of 108 total issues

Method registration has 512 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function registration($app)
{
    // Library group
    $app->group('/registrazione', function () use ($app) {

Severity: Major
Found in includes/api/registration.php - About 2 days to fix

    Method sfide has 482 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function sfide($app)
    {
        $app->group('/sfide', function () use ($app) {
    
            $app->get('/:id', function ($sfida_id) use ($app) {
    Severity: Major
    Found in includes/api/sfide.php - About 2 days to fix

      File registration.php has 519 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      use Dreamland\Errori;
      use Dreamland\Ruoli;
      use RedBean_Facade as R;
      Severity: Major
      Found in includes/api/registration.php - About 1 day to fix

        File sfide.php has 492 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        use BitPrepared\Event\EventElement;
        use BitPrepared\Event\EventManager;
        use Dreamland\Errori;
        Severity: Minor
        Found in includes/api/sfide.php - About 7 hrs to fix

          Method squadriglia has 168 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function squadriglia($app)
          {
              $app->group('/squadriglia', function () use ($app) {
          
                  $app->get('/', function () use ($app) {
          Severity: Major
          Found in includes/api/squadriglia.php - About 6 hrs to fix

            Method editor has 157 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function editor($app)
            {
                // Library group
                $app->group('/editor', function () use ($app) {
            
            
            Severity: Major
            Found in includes/api/editor.php - About 6 hrs to fix

              Function sfideController has 122 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                var sfideController = dreamApp.controller('SfideController', function ($scope, $q, $rootScope, $http, $state, ngDialog, $stateParams, Portal, $window) {
              
                  $scope.sfidaid = angular.isDefined($stateParams.id) ? $stateParams.id : -1;
                  $scope.squadriglia = null;
                  $scope.sfida = null;
              Severity: Major
              Found in public/app/Sfide/SfideController.js - About 4 hrs to fix

                Function registrationController has 115 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  var registrationController = dreamApp.controller('RegistrationController', function ($scope, $rootScope, $http, $state, ngDialog, Portal, $stateParams, $window) {
                
                    $scope.ruolisquadriglia = [ {'desc' : 'Altro' , 'code' : 3}, {'desc' : 'Capo Sq.', 'code' : 1}, {'desc' : 'Vice capo Sq.', 'code' : 2} ];
                
                    $scope.caller = '';
                Severity: Major
                Found in public/app/Registration/RegistrationController.js - About 4 hrs to fix

                  Function chiusuraController has 97 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      var chiusuraController = dreamApp.controller('ChiusuraController', function ($scope, $q, $rootScope, $http, $state, ngDialog, $stateParams, Portal, $window, $log) {
                  
                          $scope.sfidaid = angular.isDefined($stateParams.id) ? $stateParams.id : -1;
                          $scope.squadriglia = null;
                          $scope.sfida = null;
                  Severity: Major
                  Found in public/app/Sfide/ChiusuraController.js - About 3 hrs to fix

                    Method asa has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function asa($app)
                    {
                        // Library group
                        $app->group('/asa', function () use ($app) {
                    
                    
                    Severity: Major
                    Found in includes/api/asa.php - About 3 hrs to fix

                      Function findDatiCapoReparto has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function findDatiCapoReparto($regione, $gruppo, $legame = null)
                      {
                          $info_cc = [];
                          if (null != $legame) {
                              $legameBean = R::findOne('legami', ' codicecensimento = ? ', [$legame]);
                      Severity: Minor
                      Found in includes/functions.php - 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

                      Method configure_slim has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function configure_slim($config)
                      {
                          $log_level = \Slim\Log::WARN;
                          $log_enable = false;
                          if (isset($config['log'])) {
                      Severity: Major
                      Found in includes/configuration.php - About 2 hrs to fix

                        Function configure_slim has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function configure_slim($config)
                        {
                            $log_level = \Slim\Log::WARN;
                            $log_enable = false;
                            if (isset($config['log'])) {
                        Severity: Minor
                        Found in includes/configuration.php - About 2 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 send has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function send($referenceCode, $toEmailAddress, $subject, $txtMessage, $htmlMessage = null, $attachment = null)
                            {
                                $this->lastId = -1;
                                $result = false;
                                foreach ($this->pipe as $sender) {
                        Severity: Minor
                        Found in src/BitPrepared/Mail/Sender/Pipe.php - 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

                        Method findDatiCapoReparto has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function findDatiCapoReparto($regione, $gruppo, $legame = null)
                        {
                            $info_cc = [];
                            if (null != $legame) {
                                $legameBean = R::findOne('legami', ' codicecensimento = ? ', [$legame]);
                        Severity: Minor
                        Found in includes/functions.php - About 1 hr to fix

                          Method livello has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function livello($livelloArrayA, $livelloArrayB, $livelloArrayC, $stelleAssoc)
                          {
                              ?>
                          <div class="container">
                          
                          
                          Severity: Minor
                          Found in resources/templates/production/ordini/dream.php - About 1 hr to fix

                            Method livello has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function livello($livelloArrayA, $livelloArrayB, $livelloArrayC, $stelleAssoc)
                            {
                                ?>
                            <div class="container">
                            
                            
                            Severity: Minor
                            Found in resources/templates/production/ordini/list.php - About 1 hr to fix

                              Method send has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function send($referenceCode, $toEmailAddress, $subject, $txtMessage, $htmlMessage = null, $attachment = null)
                                  {
                                      $this->lastId = -1;
                              
                                      try {
                              Severity: Minor
                              Found in src/BitPrepared/Mail/Sender/Swift.php - About 1 hr to fix

                                Function editorController has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    var editorController = dreamApp.controller('EditorController', function ($scope, $rootScope, $http, $log,$state, $stateParams) {
                                
                                        $scope.stato = "alert-info";
                                        $scope.result = ".";
                                        $scope.gruppo = null;
                                Severity: Minor
                                Found in public/app/Editor/EditorController.js - About 1 hr to fix

                                  Function portal has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    var portal = sharedServicesModule.service('Portal', function ($http) {
                                      
                                      this.loadSquadriglia = function (x,y) {
                                          $http.get('./api/squadriglia/').
                                            success(function(data, status, headers, config) {
                                  Severity: Minor
                                  Found in public/app/Portal/PortalService.js - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language