CORE-POS/IS4C

View on GitHub
fannie/modules/plugins2.0/CoopDealsSigns/WfcSmartSigns2UpP.php

Summary

Maintainability
F
3 days
Test Coverage

Function getTopImage has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
Open

    private function getTopImage($item)
    {
        // Manual Signs Page && smartType override checked takes precedence
        if (isset($item['smartType']) && $item['smartType'] == 'CoopDeals') {
            return __DIR__ . '/noauto/images/codeals_top_2.png';
Severity: Minor
Found in fannie/modules/plugins2.0/CoopDealsSigns/WfcSmartSigns2UpP.php - About 6 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 getBottomImage has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    private function getBottomImage($item)
    {
        // Manual Signs Page && smartType override checked takes precedence
        if (isset($item['smartType']) && $item['smartType'] == 'CoopDeals') {
            return __DIR__ . '/cd_line_16.png';
Severity: Minor
Found in fannie/modules/plugins2.0/CoopDealsSigns/WfcSmartSigns2UpP.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 drawPDF has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function drawPDF()
    {
        $pdf = $this->createPDF();
        $dbc = FannieDB::get(FannieConfig::config('OP_DB'));
        $basicP = $dbc->prepare("SELECT
Severity: Major
Found in fannie/modules/plugins2.0/CoopDealsSigns/WfcSmartSigns2UpP.php - About 2 hrs to fix

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

        public function drawPDF()
        {
            $pdf = $this->createPDF();
            $dbc = FannieDB::get(FannieConfig::config('OP_DB'));
            $basicP = $dbc->prepare("SELECT
    Severity: Minor
    Found in fannie/modules/plugins2.0/CoopDealsSigns/WfcSmartSigns2UpP.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 getTopImage has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function getTopImage($item)
        {
            // Manual Signs Page && smartType override checked takes precedence
            if (isset($item['smartType']) && $item['smartType'] == 'CoopDeals') {
                return __DIR__ . '/noauto/images/codeals_top_2.png';
    Severity: Minor
    Found in fannie/modules/plugins2.0/CoopDealsSigns/WfcSmartSigns2UpP.php - About 1 hr to fix

      Method getBottomImage has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function getBottomImage($item)
          {
              // Manual Signs Page && smartType override checked takes precedence
              if (isset($item['smartType']) && $item['smartType'] == 'CoopDeals') {
                  return __DIR__ . '/cd_line_16.png';
      Severity: Minor
      Found in fannie/modules/plugins2.0/CoopDealsSigns/WfcSmartSigns2UpP.php - About 1 hr to fix

        Avoid too many return statements within this method.
        Open

                    return __DIR__ . '/noauto/images/chaching_bottom_12.png';
        Severity: Major
        Found in fannie/modules/plugins2.0/CoopDealsSigns/WfcSmartSigns2UpP.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return __DIR__ . '/noauto/images/standard_bottom_12.png';
          Severity: Major
          Found in fannie/modules/plugins2.0/CoopDealsSigns/WfcSmartSigns2UpP.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return __DIR__ . '/noauto/images/chaching_top_2.png';
            Severity: Major
            Found in fannie/modules/plugins2.0/CoopDealsSigns/WfcSmartSigns2UpP.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return 'EXTRAS';
              Severity: Major
              Found in fannie/modules/plugins2.0/CoopDealsSigns/WfcSmartSigns2UpP.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return __DIR__ . '/noauto/images/local-top.png';
                Severity: Major
                Found in fannie/modules/plugins2.0/CoopDealsSigns/WfcSmartSigns2UpP.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                              return __DIR__ . '/noauto/images/organic_top_12.png';
                  Severity: Major
                  Found in fannie/modules/plugins2.0/CoopDealsSigns/WfcSmartSigns2UpP.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return __DIR__ . '/noauto/images/freshdeals_top_2.png';
                    Severity: Major
                    Found in fannie/modules/plugins2.0/CoopDealsSigns/WfcSmartSigns2UpP.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              return __DIR__ . '/noauto/images/standard_top_12.png';
                      Severity: Major
                      Found in fannie/modules/plugins2.0/CoopDealsSigns/WfcSmartSigns2UpP.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return __DIR__ . '/noauto/images/codeals_top_2.png';
                        Severity: Major
                        Found in fannie/modules/plugins2.0/CoopDealsSigns/WfcSmartSigns2UpP.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                      return __DIR__ . '/noauto/images/organic_top_12.png';
                          Severity: Major
                          Found in fannie/modules/plugins2.0/CoopDealsSigns/WfcSmartSigns2UpP.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                        return __DIR__ . '/noauto/images/freshdeals_bottom_2.png';
                            Severity: Major
                            Found in fannie/modules/plugins2.0/CoopDealsSigns/WfcSmartSigns2UpP.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                          return __DIR__ . '/noauto/images/local_og_bottom.png';
                              Severity: Major
                              Found in fannie/modules/plugins2.0/CoopDealsSigns/WfcSmartSigns2UpP.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                            return __DIR__ . '/noauto/images/organic_bottom_12.png';
                                Severity: Major
                                Found in fannie/modules/plugins2.0/CoopDealsSigns/WfcSmartSigns2UpP.php - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                              return __DIR__ . '/noauto/images/organic_bottom_12.png';
                                  Severity: Major
                                  Found in fannie/modules/plugins2.0/CoopDealsSigns/WfcSmartSigns2UpP.php - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                return __DIR__ . '/noauto/images/basics_bottom_12.png';
                                    Severity: Major
                                    Found in fannie/modules/plugins2.0/CoopDealsSigns/WfcSmartSigns2UpP.php - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                                  return __DIR__ . '/noauto/images/local-top.png';
                                      Severity: Major
                                      Found in fannie/modules/plugins2.0/CoopDealsSigns/WfcSmartSigns2UpP.php - About 30 mins to fix

                                        Avoid too many return statements within this method.
                                        Open

                                                    return __DIR__ . '/cd_line_16.png';
                                        Severity: Major
                                        Found in fannie/modules/plugins2.0/CoopDealsSigns/WfcSmartSigns2UpP.php - About 30 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

                                                      return __DIR__ . '/noauto/images/basics_top_12.png';
                                          Severity: Major
                                          Found in fannie/modules/plugins2.0/CoopDealsSigns/WfcSmartSigns2UpP.php - About 30 mins to fix

                                            Avoid too many return statements within this method.
                                            Open

                                                        return __DIR__ . '/noauto/images/local_og_top.png';
                                            Severity: Major
                                            Found in fannie/modules/plugins2.0/CoopDealsSigns/WfcSmartSigns2UpP.php - About 30 mins to fix

                                              Avoid too many return statements within this method.
                                              Open

                                                          return __DIR__ . '/noauto/images/local_og_top.png';
                                              Severity: Major
                                              Found in fannie/modules/plugins2.0/CoopDealsSigns/WfcSmartSigns2UpP.php - About 30 mins to fix

                                                Avoid too many return statements within this method.
                                                Open

                                                            return __DIR__ . '/noauto/images/local-bottom.png';
                                                Severity: Major
                                                Found in fannie/modules/plugins2.0/CoopDealsSigns/WfcSmartSigns2UpP.php - About 30 mins to fix

                                                  There are no issues that match your filters.

                                                  Category
                                                  Status