CORE-POS/IS4C

View on GitHub
fannie/modules/plugins2.0/PIKiller/PIMemberPage.php

Summary

Maintainability
F
5 days
Test Coverage

Method get_id_view has 258 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function get_id_view()
    {
        global $FANNIE_OP_DB, $FANNIE_URL;
        $dbc = FannieDB::get($FANNIE_OP_DB);
        $limitedEdit = $this->auth_mode == 'Full' ? False : True;
Severity: Major
Found in fannie/modules/plugins2.0/PIKiller/PIMemberPage.php - About 1 day to fix

    File PIMemberPage.php has 552 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php 
    /*******************************************************************************
    
        Copyright 2013 Whole Foods Co-op
    
    
    Severity: Major
    Found in fannie/modules/plugins2.0/PIKiller/PIMemberPage.php - About 1 day to fix

      Function get_id_view has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function get_id_view()
          {
              global $FANNIE_OP_DB, $FANNIE_URL;
              $dbc = FannieDB::get($FANNIE_OP_DB);
              $limitedEdit = $this->auth_mode == 'Full' ? False : True;
      Severity: Minor
      Found in fannie/modules/plugins2.0/PIKiller/PIMemberPage.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

      Method post_id_handler has 135 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function post_id_handler()
          {
              global $FANNIE_OP_DB, $FANNIE_TRANS_DB;
              $this->card_no = $this->id;
              if ($this->auth_mode == 'None')
      Severity: Major
      Found in fannie/modules/plugins2.0/PIKiller/PIMemberPage.php - About 5 hrs to fix

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

            protected function post_id_handler()
            {
                global $FANNIE_OP_DB, $FANNIE_TRANS_DB;
                $this->card_no = $this->id;
                if ($this->auth_mode == 'None')
        Severity: Minor
        Found in fannie/modules/plugins2.0/PIKiller/PIMemberPage.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 text_or_select has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

            private function text_or_select($name, $value, $opts, $labels=array(), $attributes=array(), $limited=False){
                if (FormLib::get_form_value('edit',False) === False || $limited){
                    if (!empty($labels)){
                        for($i=0;$i<count($opts);$i++){
                            if ($opts[$i] == $value)
        Severity: Minor
        Found in fannie/modules/plugins2.0/PIKiller/PIMemberPage.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 get_id_handler has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function get_id_handler()
            {
                global $FANNIE_OP_DB, $FANNIE_TRANS_DB;
                $this->card_no = $this->id;
        
        
        Severity: Minor
        Found in fannie/modules/plugins2.0/PIKiller/PIMemberPage.php - About 1 hr to fix

          Method text_or_area has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function text_or_area($name, $value, $attributes=array(), $swap=0, $limited=False){
                  if (FormLib::get_form_value('edit',False) === False || $limited){
                      switch($swap){
                      case 1:
                          return str_replace("\n",'<br />',$value);
          Severity: Minor
          Found in fannie/modules/plugins2.0/PIKiller/PIMemberPage.php - About 1 hr to fix

            Function text_or_area has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                private function text_or_area($name, $value, $attributes=array(), $swap=0, $limited=False){
                    if (FormLib::get_form_value('edit',False) === False || $limited){
                        switch($swap){
                        case 1:
                            return str_replace("\n",'<br />',$value);
            Severity: Minor
            Found in fannie/modules/plugins2.0/PIKiller/PIMemberPage.php - About 55 mins 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 preprocess has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                function preprocess(){
                    if (FannieAuth::validateUserQuiet('editmembers'))
                        $this->auth_mode = 'Full';
                    elseif (FannieAuth::validateUserQuiet('editmembers_csc'))
                        $this->auth_mode = 'Limited';
            Severity: Minor
            Found in fannie/modules/plugins2.0/PIKiller/PIMemberPage.php - About 55 mins 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 get_id_handler has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function get_id_handler()
                {
                    global $FANNIE_OP_DB, $FANNIE_TRANS_DB;
                    $this->card_no = $this->id;
            
            
            Severity: Minor
            Found in fannie/modules/plugins2.0/PIKiller/PIMemberPage.php - About 55 mins 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 text_or_select has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                private function text_or_select($name, $value, $opts, $labels=array(), $attributes=array(), $limited=False){
            Severity: Minor
            Found in fannie/modules/plugins2.0/PIKiller/PIMemberPage.php - About 45 mins to fix

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

                  private function text_or_area($name, $value, $attributes=array(), $swap=0, $limited=False){
              Severity: Minor
              Found in fannie/modules/plugins2.0/PIKiller/PIMemberPage.php - About 35 mins to fix

                There are no issues that match your filters.

                Category
                Status