src/Shop/Views/Tax.php

Summary

Maintainability
D
3 days
Test Coverage

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

    public static function productTaxes ($request, $match)
    {
        $product = Pluf_Shortcuts_GetObjectOr404('Shop_Product', $match['productId']);
        $tax = new Shop_TaxClass();
        $taxTable = $tax->_a['table'];
Severity: Minor
Found in src/Shop/Views/Tax.php - About 1 hr to fix

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

        public static function serviceTaxes ($request, $match)
        {
            $service = Pluf_Shortcuts_GetObjectOr404('Shop_Service', $match['serviceId']);
            $tax = new Shop_TaxClass();
            $taxTable = $tax->_a['table'];
    Severity: Minor
    Found in src/Shop/Views/Tax.php - About 1 hr to fix

      Missing class import via use statement (line '23', column '26').
      Open

              $paginator = new Pluf_Paginator($tax);
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpmd

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      Missing class import via use statement (line '24', column '20').
      Open

              $sql = new Pluf_SQL('shop_product_id=%s', 
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpmd

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      Missing class import via use statement (line '14', column '20').
      Open

              $tax = new Shop_TaxClass();
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpmd

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      Missing class import via use statement (line '91', column '26').
      Open

              $paginator = new Pluf_Paginator($tax);
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpmd

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      Missing class import via use statement (line '82', column '20').
      Open

              $tax = new Shop_TaxClass();
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpmd

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      Missing class import via use statement (line '92', column '20').
      Open

              $sql = new Pluf_SQL('shop_service_id=%s',
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpmd

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      The method removeServiceTax uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  $taxId = $request->REQUEST['id'];
              }
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpmd

      ElseExpression

      Since: 1.4.0

      An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($flag) {
                  // one branch
              } else {
                  // another branch
              }
          }
      }

      Source https://phpmd.org/rules/cleancode.html#elseexpression

      The method removeProductTax uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  $taxId = $request->REQUEST['id'];
              }
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpmd

      ElseExpression

      Since: 1.4.0

      An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($flag) {
                  // one branch
              } else {
                  // another branch
              }
          }
      }

      Source https://phpmd.org/rules/cleancode.html#elseexpression

      The method addProductTax uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  $taxId = $request->REQUEST['id'];
              }
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpmd

      ElseExpression

      Since: 1.4.0

      An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($flag) {
                  // one branch
              } else {
                  // another branch
              }
          }
      }

      Source https://phpmd.org/rules/cleancode.html#elseexpression

      The method addServiceTax uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  $taxId = $request->REQUEST['id'];
              }
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpmd

      ElseExpression

      Since: 1.4.0

      An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($flag) {
                  // one branch
              } else {
                  // another branch
              }
          }
      }

      Source https://phpmd.org/rules/cleancode.html#elseexpression

      Define a constant instead of duplicating this literal "Shop_Service" 3 times.
      Open

              $service = Pluf_Shortcuts_GetObjectOr404('Shop_Service', $match['serviceId']);
      Severity: Critical
      Found in src/Shop/Views/Tax.php by sonar-php

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

      Define a constant instead of duplicating this literal "myView" 4 times.
      Open

              $tax->_a['views']['myView'] = array(
      Severity: Critical
      Found in src/Shop/Views/Tax.php by sonar-php

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

      Define a constant instead of duplicating this literal "Shop_Product" 3 times.
      Open

              $product = Pluf_Shortcuts_GetObjectOr404('Shop_Product', $match['productId']);
      Severity: Critical
      Found in src/Shop/Views/Tax.php by sonar-php

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

      Define a constant instead of duplicating this literal "title" 4 times.
      Open

                      'title'
      Severity: Critical
      Found in src/Shop/Views/Tax.php by sonar-php

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

      Define a constant instead of duplicating this literal "productId" 3 times.
      Open

              $product = Pluf_Shortcuts_GetObjectOr404('Shop_Product', $match['productId']);
      Severity: Critical
      Found in src/Shop/Views/Tax.php by sonar-php

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

      Define a constant instead of duplicating this literal "serviceId" 3 times.
      Open

              $service = Pluf_Shortcuts_GetObjectOr404('Shop_Service', $match['serviceId']);
      Severity: Critical
      Found in src/Shop/Views/Tax.php by sonar-php

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

      Define a constant instead of duplicating this literal "Shop_TaxClass" 4 times.
      Open

              $tax = Pluf_Shortcuts_GetObjectOr404('Shop_TaxClass', $taxId);
      Severity: Critical
      Found in src/Shop/Views/Tax.php by sonar-php

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

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

          public static function productTaxes ($request, $match)
          {
              $product = Pluf_Shortcuts_GetObjectOr404('Shop_Product', $match['productId']);
              $tax = new Shop_TaxClass();
              $taxTable = $tax->_a['table'];
      Severity: Major
      Found in src/Shop/Views/Tax.php and 1 other location - About 1 day to fix
      src/Shop/Views/Tax.php on lines 79..116

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

      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 static function serviceTaxes ($request, $match)
          {
              $service = Pluf_Shortcuts_GetObjectOr404('Shop_Service', $match['serviceId']);
              $tax = new Shop_TaxClass();
              $taxTable = $tax->_a['table'];
      Severity: Major
      Found in src/Shop/Views/Tax.php and 1 other location - About 1 day to fix
      src/Shop/Views/Tax.php on lines 11..48

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

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

          public static function removeServiceTax ($request, $match)
          {
              $service = Pluf_Shortcuts_GetObjectOr404('Shop_Service', $match['serviceId']);
              if (isset($match['id'])) {
                  $taxId = $match['id'];
      Severity: Major
      Found in src/Shop/Views/Tax.php and 7 other locations - About 1 hr to fix
      src/Shop/Views/Agency.php on lines 55..66
      src/Shop/Views/Agency.php on lines 68..79
      src/Shop/Views/Tax.php on lines 50..61
      src/Shop/Views/Tax.php on lines 63..74
      src/Shop/Views/Tax.php on lines 118..129
      src/Shop/Views/Zone.php on lines 52..63
      src/Shop/Views/Zone.php on lines 65..76

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

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

          public static function removeProductTax ($request, $match)
          {
              $product = Pluf_Shortcuts_GetObjectOr404('Shop_Product', $match['productId']);
              if (isset($match['id'])) {
                  $taxId = $match['id'];
      Severity: Major
      Found in src/Shop/Views/Tax.php and 7 other locations - About 1 hr to fix
      src/Shop/Views/Agency.php on lines 55..66
      src/Shop/Views/Agency.php on lines 68..79
      src/Shop/Views/Tax.php on lines 50..61
      src/Shop/Views/Tax.php on lines 118..129
      src/Shop/Views/Tax.php on lines 131..142
      src/Shop/Views/Zone.php on lines 52..63
      src/Shop/Views/Zone.php on lines 65..76

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

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

          public static function addServiceTax ($request, $match)
          {
              $service = Pluf_Shortcuts_GetObjectOr404('Shop_Service', $match['serviceId']);
              if (isset($match['id'])) {
                  $taxId = $match['id'];
      Severity: Major
      Found in src/Shop/Views/Tax.php and 7 other locations - About 1 hr to fix
      src/Shop/Views/Agency.php on lines 55..66
      src/Shop/Views/Agency.php on lines 68..79
      src/Shop/Views/Tax.php on lines 50..61
      src/Shop/Views/Tax.php on lines 63..74
      src/Shop/Views/Tax.php on lines 131..142
      src/Shop/Views/Zone.php on lines 52..63
      src/Shop/Views/Zone.php on lines 65..76

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

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

          public static function addProductTax ($request, $match)
          {
              $product = Pluf_Shortcuts_GetObjectOr404('Shop_Product', $match['productId']);
              if (isset($match['id'])) {
                  $taxId = $match['id'];
      Severity: Major
      Found in src/Shop/Views/Tax.php and 7 other locations - About 1 hr to fix
      src/Shop/Views/Agency.php on lines 55..66
      src/Shop/Views/Agency.php on lines 68..79
      src/Shop/Views/Tax.php on lines 63..74
      src/Shop/Views/Tax.php on lines 118..129
      src/Shop/Views/Tax.php on lines 131..142
      src/Shop/Views/Zone.php on lines 52..63
      src/Shop/Views/Zone.php on lines 65..76

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

      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

      Each class must be in a namespace of at least one level (a top-level vendor name)
      Open

      class Shop_Views_Tax
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpcodesniffer

      A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 5 and the first side effect is on line 2.
      Open

      <?php
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpcodesniffer

      The class Shop_Views_Tax is not named in CamelCase.
      Open

      class Shop_Views_Tax
      {
      
          // *******************************************************************
          // Taxes of Product
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpmd

      CamelCaseClassName

      Since: 0.2

      It is considered best practice to use the CamelCase notation to name classes.

      Example

      class class_name {
      }

      Source

      Expected "function abc(...)"; found "function abc (...)"
      Open

          public static function serviceTaxes ($request, $match)
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpcodesniffer

      Expected 0 spaces before opening parenthesis; 1 found
      Open

          public static function serviceTaxes ($request, $match)
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpcodesniffer

      Expected "function abc(...)"; found "function abc (...)"
      Open

          public static function productTaxes ($request, $match)
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpcodesniffer

      Expected "function abc(...)"; found "function abc (...)"
      Open

          public static function removeServiceTax ($request, $match)
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpcodesniffer

      Expected 0 spaces before opening parenthesis; 1 found
      Open

          public static function productTaxes ($request, $match)
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpcodesniffer

      Expected "function abc(...)"; found "function abc (...)"
      Open

          public static function removeProductTax ($request, $match)
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpcodesniffer

      Expected 0 spaces before opening parenthesis; 1 found
      Open

          public static function removeProductTax ($request, $match)
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpcodesniffer

      Expected "function abc(...)"; found "function abc (...)"
      Open

          public static function addServiceTax ($request, $match)
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpcodesniffer

      Expected "function abc(...)"; found "function abc (...)"
      Open

          public static function addProductTax ($request, $match)
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpcodesniffer

      The closing brace for the class must go on the next line after the body
      Open

      }
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpcodesniffer

      Expected 0 spaces before opening parenthesis; 1 found
      Open

          public static function removeServiceTax ($request, $match)
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpcodesniffer

      Expected 0 spaces before opening parenthesis; 1 found
      Open

          public static function addProductTax ($request, $match)
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpcodesniffer

      Expected 0 spaces before opening parenthesis; 1 found
      Open

          public static function addServiceTax ($request, $match)
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpcodesniffer

      Opening parenthesis of a multi-line function call must be the last content on the line
      Open

              $sql = new Pluf_SQL('shop_service_id=%s',
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpcodesniffer

      Closing parenthesis of a multi-line function call must be on a line by itself
      Open

                      ));
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpcodesniffer

      Opening parenthesis of a multi-line function call must be the last content on the line
      Open

              $sql = new Pluf_SQL('shop_product_id=%s', 
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpcodesniffer

      Multi-line function call not indented correctly; expected 8 spaces but found 12
      Open

                  ));
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpcodesniffer

      Class name "Shop_Views_Tax" is not in camel caps format
      Open

      class Shop_Views_Tax
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpcodesniffer

      Multi-line function call not indented correctly; expected 8 spaces but found 16
      Open

                      ));
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpcodesniffer

      Expected 1 newline at end of file; 0 found
      Open

      }
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpcodesniffer

      Closing parenthesis of a multi-line function call must be on a line by itself
      Open

                  ));
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpcodesniffer

      Whitespace found at end of line
      Open

              $sql = new Pluf_SQL('shop_product_id=%s', 
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpcodesniffer

      Multi-line function call not indented correctly; expected 12 spaces but found 16
      Open

                      array(
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpcodesniffer

      The variable $sort_fields is not named in camelCase.
      Open

          public static function serviceTaxes ($request, $match)
          {
              $service = Pluf_Shortcuts_GetObjectOr404('Shop_Service', $match['serviceId']);
              $tax = new Shop_TaxClass();
              $taxTable = $tax->_a['table'];
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpmd

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $sort_fields is not named in camelCase.
      Open

          public static function productTaxes ($request, $match)
          {
              $product = Pluf_Shortcuts_GetObjectOr404('Shop_Product', $match['productId']);
              $tax = new Shop_TaxClass();
              $taxTable = $tax->_a['table'];
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpmd

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $search_fields is not named in camelCase.
      Open

          public static function productTaxes ($request, $match)
          {
              $product = Pluf_Shortcuts_GetObjectOr404('Shop_Product', $match['productId']);
              $tax = new Shop_TaxClass();
              $taxTable = $tax->_a['table'];
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpmd

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $search_fields is not named in camelCase.
      Open

          public static function serviceTaxes ($request, $match)
          {
              $service = Pluf_Shortcuts_GetObjectOr404('Shop_Service', $match['serviceId']);
              $tax = new Shop_TaxClass();
              $taxTable = $tax->_a['table'];
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpmd

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $sort_fields is not named in camelCase.
      Open

          public static function serviceTaxes ($request, $match)
          {
              $service = Pluf_Shortcuts_GetObjectOr404('Shop_Service', $match['serviceId']);
              $tax = new Shop_TaxClass();
              $taxTable = $tax->_a['table'];
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpmd

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $search_fields is not named in camelCase.
      Open

          public static function productTaxes ($request, $match)
          {
              $product = Pluf_Shortcuts_GetObjectOr404('Shop_Product', $match['productId']);
              $tax = new Shop_TaxClass();
              $taxTable = $tax->_a['table'];
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpmd

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $sort_fields is not named in camelCase.
      Open

          public static function productTaxes ($request, $match)
          {
              $product = Pluf_Shortcuts_GetObjectOr404('Shop_Product', $match['productId']);
              $tax = new Shop_TaxClass();
              $taxTable = $tax->_a['table'];
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpmd

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $search_fields is not named in camelCase.
      Open

          public static function serviceTaxes ($request, $match)
          {
              $service = Pluf_Shortcuts_GetObjectOr404('Shop_Service', $match['serviceId']);
              $tax = new Shop_TaxClass();
              $taxTable = $tax->_a['table'];
      Severity: Minor
      Found in src/Shop/Views/Tax.php by phpmd

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      There are no issues that match your filters.

      Category
      Status