amtgard/ORK3

View on GitHub
orkui/controller/controller.Admin.php

Summary

Maintainability
F
1 mo
Test Coverage

File controller.Admin.php has 1425 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

class Controller_Admin extends Controller {

    public function __construct($call=null, $id=null) {
Severity: Major
Found in orkui/controller/controller.Admin.php - About 3 days to fix

    Function player has a Cognitive Complexity of 134 (exceeds 5 allowed). Consider refactoring.
    Open

        public function player($id) {
            logtrace("player call", $_REQUEST);
            $this->load_model('Player');
            $this->load_model('Award');
            $this->load_model('Unit');
    Severity: Minor
    Found in orkui/controller/controller.Admin.php - About 2 days 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 player has 261 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function player($id) {
            logtrace("player call", $_REQUEST);
            $this->load_model('Player');
            $this->load_model('Award');
            $this->load_model('Unit');
    Severity: Major
    Found in orkui/controller/controller.Admin.php - About 1 day to fix

      Function editkingdom has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
      Open

          public function editkingdom($id) {
              $this->kingdom_route($id);
      
              if (isset($this->request->Action)) {
                  $this->request->save('Admin_editkingdom', true);
      Severity: Minor
      Found in orkui/controller/controller.Admin.php - About 1 day 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 createpark has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
      Open

          public function createpark($params=null) {
              $params = explode('/',$params);
              if ('submit' == $params[0]) {
                  $post = 'submit';
                  $this->data['KingdomId'] = $this->session->kingdom_id;
      Severity: Minor
      Found in orkui/controller/controller.Admin.php - About 1 day 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 createplayer has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
      Open

          public function createplayer($params=null) {
              $params = explode('/',$params);
              if ('submit' == $params[0]) {
                  $post = 'submit';
              } else if ('park' == $params[0]) {
      Severity: Minor
      Found in orkui/controller/controller.Admin.php - About 7 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 editkingdom has 149 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function editkingdom($id) {
              $this->kingdom_route($id);
      
              if (isset($this->request->Action)) {
                  $this->request->save('Admin_editkingdom', true);
      Severity: Major
      Found in orkui/controller/controller.Admin.php - About 5 hrs to fix

        Function setparkofficers has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
        Open

            public function setparkofficers($post=null) {
                $this->load_model('Park');
                if (strlen($post) > 0) {
                    $this->request->save('Admin_setofficers', true);
                    if (!isset($this->session->user_id)) {
        Severity: Minor
        Found in orkui/controller/controller.Admin.php - About 5 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 editpark has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
        Open

            public function editpark($park_id) {
                if (strlen($this->request->Action) > 0) {
                    $this->request->save('Admin_editpark', true);
                    if (!isset($this->session->user_id)) {
                        header( 'Location: '.UIR.'Login/login/Admin/editpark/' . $park_id );
        Severity: Minor
        Found in orkui/controller/controller.Admin.php - About 5 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 setkingdomofficers has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
        Open

            public function setkingdomofficers($post=null) {
                $this->load_model('Kingdom');
                if (strlen($post) > 0) {
                    $this->request->save('Admin_setofficers', true);
                    if (!isset($this->session->user_id)) {
        Severity: Minor
        Found in orkui/controller/controller.Admin.php - About 5 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 unit has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

            public function unit($unit_id) {
                unset($this->session->kingdom_id);
                unset($this->session->kingdom_name);
                unset($this->session->park_name);
                unset($this->session->park_id);
        Severity: Minor
        Found in orkui/controller/controller.Admin.php - About 4 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 event has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

            public function event($p) {
                $params = explode('/',$p);
                $event_id = $params[0];
                if (count($params) > 1) $post = $params[1];
        
        
        Severity: Minor
        Found in orkui/controller/controller.Admin.php - About 4 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 unit has 98 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function unit($unit_id) {
                unset($this->session->kingdom_id);
                unset($this->session->kingdom_name);
                unset($this->session->park_name);
                unset($this->session->park_id);
        Severity: Major
        Found in orkui/controller/controller.Admin.php - About 3 hrs to fix

          Method editpark has 90 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function editpark($park_id) {
                  if (strlen($this->request->Action) > 0) {
                      $this->request->save('Admin_editpark', true);
                      if (!isset($this->session->user_id)) {
                          header( 'Location: '.UIR.'Login/login/Admin/editpark/' . $park_id );
          Severity: Major
          Found in orkui/controller/controller.Admin.php - About 3 hrs to fix

            Controller_Admin has 29 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class Controller_Admin extends Controller {
            
                public function __construct($call=null, $id=null) {
                    parent::__construct($call, $id);
            
            
            Severity: Minor
            Found in orkui/controller/controller.Admin.php - About 3 hrs to fix

              Function editparks has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function editparks($kingdom_id) {
                      $this->load_model('Kingdom');
                      if (strlen($this->request->Action) > 0) {
                          $this->request->save('Admin_editparks', true);
                          if (!isset($this->session->user_id)) {
              Severity: Minor
              Found in orkui/controller/controller.Admin.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 event has 83 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function event($p) {
                      $params = explode('/',$p);
                      $event_id = $params[0];
                      if (count($params) > 1) $post = $params[1];
              
              
              Severity: Major
              Found in orkui/controller/controller.Admin.php - About 3 hrs to fix

                Function claimplayer has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function claimplayer($params=null) {
                        $params = explode('/',$params);
                        if ('submit' == $params[0]) {
                            $post = 'submit';
                        } else if ('park' == $params[0]) {
                Severity: Minor
                Found in orkui/controller/controller.Admin.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

                Function mergeplayer has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function mergeplayer($params=null) {
                        $params = explode('/',$params);
                        if ('submit' == $params[0]) {
                            $post = 'submit';
                        } else if ('park' == $params[0]) {
                Severity: Minor
                Found in orkui/controller/controller.Admin.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

                Function createkingdom has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function createkingdom($post=null) {
                        if (strlen($post) > 0) {
                            $this->request->save('Admin_createkingdom', true);
                            if (!isset($this->session->user_id)) {
                                header( 'Location: '.UIR.'Login/login/Admin/createkingdom' );
                Severity: Minor
                Found in orkui/controller/controller.Admin.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

                Function manageevent has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function manageevent($post=null) {
                        $this->load_model('Event');
                        $this->request->save('Admin_manageevent', true);
                        if (strlen($post) > 0) {
                            if (!isset($this->session->user_id)) {
                Severity: Minor
                Found in orkui/controller/controller.Admin.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

                Method createplayer has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function createplayer($params=null) {
                        $params = explode('/',$params);
                        if ('submit' == $params[0]) {
                            $post = 'submit';
                        } else if ('park' == $params[0]) {
                Severity: Major
                Found in orkui/controller/controller.Admin.php - About 2 hrs to fix

                  Function suspendplayer has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function suspendplayer($post=null) {
                          $this->load_model('Player');
                          if (strlen($post) > 0) {
                              $this->request->save('Admin_suspendplayer', true);
                              if (!isset($this->session->user_id)) {
                  Severity: Minor
                  Found in orkui/controller/controller.Admin.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 authorization has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function authorization($post=null) {
                          $this->load_model('Authorization');
                          $this->load_model('Reports');
                          if (strlen($post) > 0) {
                              $this->request->save('Admin_authorization', true);
                  Severity: Minor
                  Found in orkui/controller/controller.Admin.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

                  Method authorization has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function authorization($post=null) {
                          $this->load_model('Authorization');
                          $this->load_model('Reports');
                          if (strlen($post) > 0) {
                              $this->request->save('Admin_authorization', true);
                  Severity: Major
                  Found in orkui/controller/controller.Admin.php - About 2 hrs to fix

                    Method createpark has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function createpark($params=null) {
                            $params = explode('/',$params);
                            if ('submit' == $params[0]) {
                                $post = 'submit';
                                $this->data['KingdomId'] = $this->session->kingdom_id;
                    Severity: Minor
                    Found in orkui/controller/controller.Admin.php - About 2 hrs to fix

                      Method manageevent has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function manageevent($post=null) {
                              $this->load_model('Event');
                              $this->request->save('Admin_manageevent', true);
                              if (strlen($post) > 0) {
                                  if (!isset($this->session->user_id)) {
                      Severity: Minor
                      Found in orkui/controller/controller.Admin.php - About 1 hr to fix

                        Method setparkofficers has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function setparkofficers($post=null) {
                                $this->load_model('Park');
                                if (strlen($post) > 0) {
                                    $this->request->save('Admin_setofficers', true);
                                    if (!isset($this->session->user_id)) {
                        Severity: Minor
                        Found in orkui/controller/controller.Admin.php - About 1 hr to fix

                          Method setkingdomofficers has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function setkingdomofficers($post=null) {
                                  $this->load_model('Kingdom');
                                  if (strlen($post) > 0) {
                                      $this->request->save('Admin_setofficers', true);
                                      if (!isset($this->session->user_id)) {
                          Severity: Minor
                          Found in orkui/controller/controller.Admin.php - About 1 hr to fix

                            Function banplayer has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function banplayer($post=null) {
                                    $this->load_model('Player');
                                    $this->load_model('Reports');
                                    if (strlen($post) > 0) {
                                        $this->request->save('Admin_banplayer', true);
                            Severity: Minor
                            Found in orkui/controller/controller.Admin.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

                            Function moveplayer has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function moveplayer($post=null) {
                                    $this->load_model('Player');
                                    if (strlen($post) > 0) {
                                        $this->request->save('Admin_moveplayer', true);
                                        if (!isset($this->session->user_id)) {
                            Severity: Minor
                            Found in orkui/controller/controller.Admin.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

                            Function mergepark has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function mergepark($submit = null) {
                                    if ($submit == 'submit' && valid_id($this->request->FromParkId) && valid_id($this->request->ToParkId)) {
                                        $this->request->save('Admin_mergepark');
                                        $r = array('Status'=>0);
                                        if (!isset($this->session->user_id)) {
                            Severity: Minor
                            Found in orkui/controller/controller.Admin.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

                            Function mergeunit has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function mergeunit($submit = null) {
                                    $this->load_model('Unit');
                                    if ($submit == 'submit' && valid_id($this->request->FromUnitId) && valid_id($this->request->ToUnitId)) {
                                        $this->request->save('Admin_mergeunit');
                                        $r = array('Status'=>0);
                            Severity: Minor
                            Found in orkui/controller/controller.Admin.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 createkingdom has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function createkingdom($post=null) {
                                    if (strlen($post) > 0) {
                                        $this->request->save('Admin_createkingdom', true);
                                        if (!isset($this->session->user_id)) {
                                            header( 'Location: '.UIR.'Login/login/Admin/createkingdom' );
                            Severity: Minor
                            Found in orkui/controller/controller.Admin.php - About 1 hr to fix

                              Function transferpark has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function transferpark($kingdom_id = 0) {
                                      $this->data['KingdomName'] = $this->Kingdom->get_kingdom_name($kingdom_id);
                                      $this->data['KingdomId'] = $kingdom_id;
                                      if ($this->request->Transfer == 'Transfer') {
                                          $this->request->save('Admin_transferpark');
                              Severity: Minor
                              Found in orkui/controller/controller.Admin.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 editparks has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function editparks($kingdom_id) {
                                      $this->load_model('Kingdom');
                                      if (strlen($this->request->Action) > 0) {
                                          $this->request->save('Admin_editparks', true);
                                          if (!isset($this->session->user_id)) {
                              Severity: Minor
                              Found in orkui/controller/controller.Admin.php - About 1 hr to fix

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

                                    public function claimplayer($params=null) {
                                        $params = explode('/',$params);
                                        if ('submit' == $params[0]) {
                                            $post = 'submit';
                                        } else if ('park' == $params[0]) {
                                Severity: Minor
                                Found in orkui/controller/controller.Admin.php - About 1 hr to fix

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

                                      public function createevent($post=null) {
                                          $this->load_model('Event');
                                          $this->request->save('Admin_event', true);
                                          if (valid_id($this->request->UnitId) || valid_id($this->request->Admin_event->CreateUnitId)) {
                                              $this->data['Events_list'] = $this->Event->GetEvents(array('UnitId' => valid_id($this->request->Admin_event->UnitId)?$this->request->Admin_event->UnitId:$this->request->UnitId, 'LimitTo' => true));
                                  Severity: Minor
                                  Found in orkui/controller/controller.Admin.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 mergeplayer has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function mergeplayer($params=null) {
                                          $params = explode('/',$params);
                                          if ('submit' == $params[0]) {
                                              $post = 'submit';
                                          } else if ('park' == $params[0]) {
                                  Severity: Minor
                                  Found in orkui/controller/controller.Admin.php - About 1 hr to fix

                                    Method suspendplayer has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function suspendplayer($post=null) {
                                            $this->load_model('Player');
                                            if (strlen($post) > 0) {
                                                $this->request->save('Admin_suspendplayer', true);
                                                if (!isset($this->session->user_id)) {
                                    Severity: Minor
                                    Found in orkui/controller/controller.Admin.php - About 1 hr to fix

                                      Consider simplifying this complex logical expression.
                                      Open

                                                                      if (
                                                                          $AwardId > 0 && (
                                                                          $this->request->Admin_editkingdom->KingdomAwardName[$AwardId] != $KAwards['Awards'][$AwardId]['KingdomAwardName'] ||
                                                                          $this->request->Admin_editkingdom->ReignLimit[$AwardId] != $KAwards['Awards'][$AwardId]['ReignLimit'] ||
                                                                          $this->request->Admin_editkingdom->MonthLimit[$AwardId] != $KAwards['Awards'][$AwardId]['MonthLimit'] ||
                                      Severity: Critical
                                      Found in orkui/controller/controller.Admin.php - About 1 hr to fix

                                        Method banplayer has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public function banplayer($post=null) {
                                                $this->load_model('Player');
                                                $this->load_model('Reports');
                                                if (strlen($post) > 0) {
                                                    $this->request->save('Admin_banplayer', true);
                                        Severity: Minor
                                        Found in orkui/controller/controller.Admin.php - About 1 hr to fix

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

                                              public function setkingdomofficers($post=null) {
                                                  $this->load_model('Kingdom');
                                                  if (strlen($post) > 0) {
                                                      $this->request->save('Admin_setofficers', true);
                                                      if (!isset($this->session->user_id)) {
                                          Severity: Major
                                          Found in orkui/controller/controller.Admin.php and 1 other location - About 3 days to fix
                                          orkui/controller/controller.Admin.php on lines 383..428

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

                                          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

                                              public function setparkofficers($post=null) {
                                                  $this->load_model('Park');
                                                  if (strlen($post) > 0) {
                                                      $this->request->save('Admin_setofficers', true);
                                                      if (!isset($this->session->user_id)) {
                                          Severity: Major
                                          Found in orkui/controller/controller.Admin.php and 1 other location - About 3 days to fix
                                          orkui/controller/controller.Admin.php on lines 336..381

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

                                          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

                                                  if (strlen($post) > 0) {
                                                      $this->request->save('Admin_claimplayer', true);
                                                      if (!isset($this->session->user_id)) {
                                                          header( 'Location: '.UIR.'Login/login/Admin/moveplayer' );
                                                      } else {
                                          Severity: Major
                                          Found in orkui/controller/controller.Admin.php and 2 other locations - About 7 hrs to fix
                                          orkui/controller/controller.Admin.php on lines 934..953
                                          orkui/controller/controller.Admin.php on lines 1037..1056

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

                                          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

                                                  if (strlen($post) > 0) {
                                                      $this->request->save('Admin_moveplayer', true);
                                                      if (!isset($this->session->user_id)) {
                                                          header( 'Location: '.UIR.'Login/login/Admin/moveplayer' );
                                                      } else {
                                          Severity: Major
                                          Found in orkui/controller/controller.Admin.php and 2 other locations - About 7 hrs to fix
                                          orkui/controller/controller.Admin.php on lines 934..953
                                          orkui/controller/controller.Admin.php on lines 972..991

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

                                          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

                                                  if (strlen($post) > 0) {
                                                      $this->request->save('Admin_mergeplayer', true);
                                                      if (!isset($this->session->user_id)) {
                                                          header( 'Location: '.UIR.'Login/login/Admin/mergeplayer' );
                                                      } else {
                                          Severity: Major
                                          Found in orkui/controller/controller.Admin.php and 2 other locations - About 7 hrs to fix
                                          orkui/controller/controller.Admin.php on lines 972..991
                                          orkui/controller/controller.Admin.php on lines 1037..1056

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

                                          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

                                                              case 'updateaward':
                                                                  $r = $this->Player->update_player_award(array(
                                                                          'Token' => $this->session->token,
                                                                          'AwardsId' => $roastbeef,
                                                                          'RecipientId' => $id,
                                          Severity: Major
                                          Found in orkui/controller/controller.Admin.php and 1 other location - About 5 hrs to fix
                                          orkui/controller/controller.Player.php on lines 122..136

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

                                          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

                                                                  if ($_FILES['Heraldry']['size'] > 0 && Common::supported_mime_types($_FILES['Heraldry']['type'])) {
                                                                      if (move_uploaded_file($_FILES['Heraldry']['tmp_name'], DIR_TMP . sprintf("p_%05d", $park_id))) {
                                                                          $h_im = file_get_contents(DIR_TMP . sprintf("p_%05d", $park_id));
                                                                          $h_imdata = base64_encode($h_im);
                                                                      } else {
                                          Severity: Major
                                          Found in orkui/controller/controller.Admin.php and 2 other locations - About 3 hrs to fix
                                          orkui/controller/controller.Admin.php on lines 445..456
                                          orkui/controller/controller.Unit.php on lines 33..44

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

                                          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

                                                          if ($_FILES['Heraldry']['size'] > 0 && Common::supported_mime_types($_FILES['Heraldry']['type'])) {
                                                              if (move_uploaded_file($_FILES['Heraldry']['tmp_name'], DIR_TMP . sprintf("e_%05d", $event_id))) {
                                                                  $h_im = file_get_contents(DIR_TMP . sprintf("e_%05d", $event_id));
                                                                  $h_imdata = base64_encode($h_im);
                                                              } else {
                                          Severity: Major
                                          Found in orkui/controller/controller.Admin.php and 2 other locations - About 3 hrs to fix
                                          orkui/controller/controller.Admin.php on lines 211..222
                                          orkui/controller/controller.Unit.php on lines 33..44

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

                                          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

                                                          if ($_FILES["Heraldry"]["size"] > 0) {
                                                              move_uploaded_file($_FILES['Heraldry']['tmp_name'], DIR_ASSETS.'tmp/'.basename($_FILES['Heraldry']['tmp_name']));
                                                              $heraldry = $this->encode_image_file(DIR_ASSETS.'tmp/'.basename($_FILES['Heraldry']['tmp_name']));
                                                              unlink(DIR_ASSETS.'tmp/'.basename($_FILES['Heraldry']['tmp_name']));
                                                          }
                                          Severity: Major
                                          Found in orkui/controller/controller.Admin.php and 2 other locations - About 2 hrs to fix
                                          orkui/controller/controller.Admin.php on lines 1090..1094
                                          orkui/controller/controller.Admin.php on lines 1095..1099

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

                                          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

                                                          if ($_FILES["Waiver"]["size"] > 0) {
                                                              move_uploaded_file($_FILES['Waiver']['tmp_name'], DIR_ASSETS.'tmp/'.basename($_FILES['Waiver']['tmp_name']));
                                                              $waiver = $this->encode_image_file(DIR_ASSETS.'tmp/'.basename($_FILES['Waiver']['tmp_name']));
                                                              unlink(DIR_ASSETS.'tmp/'.basename($_FILES['Waiver']['tmp_name']));
                                                          }
                                          Severity: Major
                                          Found in orkui/controller/controller.Admin.php and 2 other locations - About 2 hrs to fix
                                          orkui/controller/controller.Admin.php on lines 1085..1089
                                          orkui/controller/controller.Admin.php on lines 1095..1099

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

                                          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

                                                          if ($_FILES["PlayerImage"]["size"] > 0) {
                                                              move_uploaded_file($_FILES['PlayerImage']['tmp_name'], DIR_ASSETS.'tmp/'.basename($_FILES['PlayerImage']['tmp_name']));
                                                              $playerimage = $this->encode_image_file(DIR_ASSETS.'tmp/'.basename($_FILES['PlayerImage']['tmp_name']));
                                                              unlink(DIR_ASSETS.'tmp/'.basename($_FILES['PlayerImage']['tmp_name']));
                                                          }
                                          Severity: Major
                                          Found in orkui/controller/controller.Admin.php and 2 other locations - About 2 hrs to fix
                                          orkui/controller/controller.Admin.php on lines 1085..1089
                                          orkui/controller/controller.Admin.php on lines 1090..1094

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

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

                                                                  if ($_FILES['Heraldry']['size'] > 0 && Common::supported_mime_types($_FILES['Heraldry']['type'])) {
                                                                      if (move_uploaded_file($_FILES['Heraldry']['tmp_name'], DIR_TMP . sprintf("u_%05d", $unit_id))) {
                                                                          $h_im = file_get_contents(DIR_TMP . sprintf("u_%05d", $unit_id));
                                                                          $h_imdata = base64_encode($h_im);
                                                                      }
                                          Severity: Major
                                          Found in orkui/controller/controller.Admin.php and 4 other locations - About 2 hrs to fix
                                          orkui/controller/controller.Admin.php on lines 1169..1174
                                          orkui/controller/controller.Admin.php on lines 1218..1223
                                          orkui/controller/controller.Player.php on lines 66..71
                                          orkui/controller/controller.Player.php on lines 72..77

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

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

                                                          if ($_FILES['Heraldry']['size'] > 0 && Common::supported_mime_types($_FILES['Heraldry']['type'])) {
                                                              if (move_uploaded_file($_FILES['Heraldry']['tmp_name'], DIR_TMP . sprintf("k_%04d", $id))) {
                                                                  $k_im = file_get_contents(DIR_TMP . sprintf("k_%04d", $id));
                                                                  $k_imdata = base64_encode($k_im);
                                                              }
                                          Severity: Major
                                          Found in orkui/controller/controller.Admin.php and 4 other locations - About 2 hrs to fix
                                          orkui/controller/controller.Admin.php on lines 114..119
                                          orkui/controller/controller.Admin.php on lines 1218..1223
                                          orkui/controller/controller.Player.php on lines 66..71
                                          orkui/controller/controller.Player.php on lines 72..77

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

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

                                                                  if ($_FILES['Heraldry']['size'] > 0 && Common::supported_mime_types($_FILES['Heraldry']['type'])) {
                                                                      if (move_uploaded_file($_FILES['Heraldry']['tmp_name'], DIR_TMP . sprintf("k_%04d", $id))) {
                                                                          $k_im = file_get_contents(DIR_TMP . sprintf("k_%04d", $id));
                                                                          $k_imdata = base64_encode($k_im);
                                                                      }
                                          Severity: Major
                                          Found in orkui/controller/controller.Admin.php and 4 other locations - About 2 hrs to fix
                                          orkui/controller/controller.Admin.php on lines 114..119
                                          orkui/controller/controller.Admin.php on lines 1169..1174
                                          orkui/controller/controller.Player.php on lines 66..71
                                          orkui/controller/controller.Player.php on lines 72..77

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

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

                                                  if ('submit' == $params[0]) {
                                                      $post = 'submit';
                                                  } else if ('park' == $params[0]) {
                                                      $park_id = $params[1];
                                                      $this->data['ParkId'] = $park_id;
                                          Severity: Major
                                          Found in orkui/controller/controller.Admin.php and 2 other locations - About 1 hr to fix
                                          orkui/controller/controller.Admin.php on lines 923..932
                                          orkui/controller/controller.Admin.php on lines 1064..1073

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

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

                                                  if ('submit' == $params[0]) {
                                                      $post = 'submit';
                                                  } else if ('park' == $params[0]) {
                                                      $park_id = $params[1];
                                                      $this->data['ParkId'] = $park_id;
                                          Severity: Major
                                          Found in orkui/controller/controller.Admin.php and 2 other locations - About 1 hr to fix
                                          orkui/controller/controller.Admin.php on lines 961..970
                                          orkui/controller/controller.Admin.php on lines 1064..1073

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

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

                                                  if ('submit' == $params[0]) {
                                                      $post = 'submit';
                                                  } else if ('park' == $params[0]) {
                                                      $park_id = $params[1];
                                                      $this->data['ParkId'] = $park_id;
                                          Severity: Major
                                          Found in orkui/controller/controller.Admin.php and 2 other locations - About 1 hr to fix
                                          orkui/controller/controller.Admin.php on lines 923..932
                                          orkui/controller/controller.Admin.php on lines 961..970

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

                                          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

                                                          if ($r['Status'] == 0) {
                                                              $this->data['Message'] = "Authorization modified.";
                                                              $this->request->clear('Admin_authorization');
                                                          } else if($r['Status'] == 5) {
                                                              header( 'Location: '.UIR.'Login' );
                                          Severity: Major
                                          Found in orkui/controller/controller.Admin.php and 1 other location - About 1 hr to fix
                                          orkui/controller/controller.Admin.php on lines 533..540

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

                                          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

                                                          if ($r['Status'] == 0) {
                                                              $this->data['Message'] = "You have created a marvelous social revel.\n<p />Let the populace rejoice. ";
                                                              $this->request->clear('Admin_manageevent');
                                                          } else if($r['Status'] == 5) {
                                                              header( 'Location: '.UIR.'Login' );
                                          Severity: Major
                                          Found in orkui/controller/controller.Admin.php and 1 other location - About 1 hr to fix
                                          orkui/controller/controller.Admin.php on lines 615..622

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

                                          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

                                                              if ($Status['Status'] == 5) {
                                                                  header( 'Location: '.UIR.'Login/login/Admin/editparks/' . $kingdom_id );
                                                              } else if ($Status['Status'] != 0) {
                                                                  $this->data['Error'] .= '<b>'.$Status['Error'].'</b>:<br />'.$Status['Detail'].'<p />';
                                                                  $error = true;
                                          Severity: Major
                                          Found in orkui/controller/controller.Admin.php and 1 other location - About 1 hr to fix
                                          orkui/controller/controller.Admin.php on lines 273..278

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

                                          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

                                                          if ($Status['Status'] == 5) {
                                                              header( 'Location: '.UIR.'Login/login/Admin/editpark/' . $park_id );
                                                          } else if ($Status['Status'] != 0) {
                                                              $this->data['Error'] .= '<b>'.$Status['Error'].'</b>:<br />'.$Status['Detail'].'<p />';
                                                              $error = true;
                                          Severity: Major
                                          Found in orkui/controller/controller.Admin.php and 1 other location - About 1 hr to fix
                                          orkui/controller/controller.Admin.php on lines 316..321

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

                                          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

                                          There are no issues that match your filters.

                                          Category
                                          Status