CORE-POS/IS4C

View on GitHub
fannie/modules/plugins2.0/CustomerServiceLog/CustomerServiceLog.php

Summary

Maintainability
F
3 days
Test Coverage

File CustomerServiceLog.php has 545 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
include(__DIR__ . '/../../../config.php');
if (!class_exists('FannieAPI')) {
    include(__DIR__ . '/../../../classlib2.0/FannieAPI.php');
}
Severity: Major
Found in fannie/modules/plugins2.0/CustomerServiceLog/CustomerServiceLog.php - About 1 day to fix

    Method inner_form_content has 151 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function inner_form_content($owner='',$firstName='',$lastName='',
            $phone='',$address='',$uid='',$date='',$subject='',$content='',$complete='')
        {
    
            $dbc = FannieDB::get($this->config->get('OP_DB'));
    Severity: Major
    Found in fannie/modules/plugins2.0/CustomerServiceLog/CustomerServiceLog.php - About 6 hrs to fix

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

          protected function get_comments($mode='new')
          {
              $id = FormLib::get('id');
              $trx = ($id) ? 'highlight' : '';
              $dbc = FannieDB::get($this->config->get('OP_DB'));
      Severity: Minor
      Found in fannie/modules/plugins2.0/CustomerServiceLog/CustomerServiceLog.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 javascriptContent has 66 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function javascriptContent()
          {
              $id = FormLib::get('id');
              return <<<HTML
      var id = {$id}
      Severity: Major
      Found in fannie/modules/plugins2.0/CustomerServiceLog/CustomerServiceLog.php - About 2 hrs to fix

        Method get_comments has 64 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function get_comments($mode='new')
            {
                $id = FormLib::get('id');
                $trx = ($id) ? 'highlight' : '';
                $dbc = FannieDB::get($this->config->get('OP_DB'));
        Severity: Major
        Found in fannie/modules/plugins2.0/CustomerServiceLog/CustomerServiceLog.php - About 2 hrs to fix

          Method post_save_handler has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function post_save_handler()
              {
                  $dbc = FannieDB::get($this->config->get('OP_DB'));
                  $id = FormLib::get('id', false);
                  $formValues = array('store','owner','firstName','lastName','phone','address',
          Severity: Minor
          Found in fannie/modules/plugins2.0/CustomerServiceLog/CustomerServiceLog.php - About 1 hr to fix

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

                protected function inner_form_content($owner='',$firstName='',$lastName='',
                    $phone='',$address='',$uid='',$date='',$subject='',$content='',$complete='')
                {
            
                    $dbc = FannieDB::get($this->config->get('OP_DB'));
            Severity: Minor
            Found in fannie/modules/plugins2.0/CustomerServiceLog/CustomerServiceLog.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 css_content has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function css_content()
                {
                    return <<<HTML
            .comment {
                background-color: rgba(255,255,255,0.3);
            Severity: Minor
            Found in fannie/modules/plugins2.0/CustomerServiceLog/CustomerServiceLog.php - About 1 hr to fix

              Method inner_form_content has 10 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  protected function inner_form_content($owner='',$firstName='',$lastName='',
                      $phone='',$address='',$uid='',$date='',$subject='',$content='',$complete='')
              Severity: Major
              Found in fannie/modules/plugins2.0/CustomerServiceLog/CustomerServiceLog.php - About 1 hr to fix

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

                    protected function post_custdata_handler()
                    {
                        $id = FormLib::get('ownerid');
                        $dbc = FannieDB::get($this->config->get('OP_DB'));
                        $json = array();
                Severity: Minor
                Found in fannie/modules/plugins2.0/CustomerServiceLog/CustomerServiceLog.php - About 1 hr to fix

                  There are no issues that match your filters.

                  Category
                  Status