lancew/DojoList

View on GitHub
lib/rss.php

Summary

Maintainability
A
1 hr
Test Coverage

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

function Add_Rss_item($item_array = null)
{
    $new_rss = RSS_header();
    $item_count = 0;
    $rss = Load_RSS_data();
Severity: Minor
Found in lib/rss.php - About 1 hr to fix

    The method Load_RSS_data uses an else expression. Else is never necessary and you can simplify the code to work without else.
    Open

        } else {
            return 'Failed to load RSS';
        }
    Severity: Minor
    Found in lib/rss.php by phpmd

    Since: PHPMD 1.4.0

    An if expression with an else branch is never necessary. You can rewrite the conditions in a way that the else is not necessary and the code becomes simpler to read. To achieve this use early return statements. To achieve this 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: http://phpmd.org/rules/cleancode.txt

    The function Save_RSS_data() contains an exit expression.
    Open

        $fh = fopen($file, 'w') or die("can't open file");
    Severity: Minor
    Found in lib/rss.php by phpmd

    Since: PHPMD 0.2

    An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

    Example:

    class Foo {
          public function bar($param)  {
              if ($param === 42) {
                  exit(23);
              }
          }
      }

    Source: http://phpmd.org/rules/design.txt

    The parameter $max_items is not named in camelCase.
    Open

    function Delete_Oldest_rss($max_items='20')
    {
        $new_rss = RSS_header();
        $item_count = 0;
        $rss = Load_RSS_data();
    Severity: Minor
    Found in lib/rss.php by phpmd

    Since: PHPMD 0.2

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

    Example:

    class ClassName {
          public function doSomething($user_name) {
          }
      }

    Source: http://phpmd.org/rules/controversial.txt

    Avoid variables with short names like $fh. Configured minimum length is 3.
    Open

        $fh = fopen($file, 'w') or die("can't open file");
    Severity: Minor
    Found in lib/rss.php by phpmd

    Since: PHPMD 0.2

    Detects when a field, local, or parameter has a very short name.

    Example:

    class Something {
          private $q = 15; // VIOLATION - Field
          public static function main( array $as ) { // VIOLATION - Formal
              $r = 20 + $this->q; // VIOLATION - Local
              for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                  $r += $this->q;
              }
          }
      }

    Source: http://phpmd.org/rules/naming.txt

    The parameter $item_array is not named in camelCase.
    Open

    function Add_Rss_item($item_array = null)
    {
        $new_rss = RSS_header();
        $item_count = 0;
        $rss = Load_RSS_data();
    Severity: Minor
    Found in lib/rss.php by phpmd

    Since: PHPMD 0.2

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

    Example:

    class ClassName {
          public function doSomething($user_name) {
          }
      }

    Source: http://phpmd.org/rules/controversial.txt

    The variable $item_count is not named in camelCase.
    Open

    function Delete_Oldest_rss($max_items='20')
    {
        $new_rss = RSS_header();
        $item_count = 0;
        $rss = Load_RSS_data();
    Severity: Minor
    Found in lib/rss.php by phpmd

    Since: PHPMD 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: http://phpmd.org/rules/controversial.txt

    The variable $new_rss is not named in camelCase.
    Open

    function Delete_Oldest_rss($max_items='20')
    {
        $new_rss = RSS_header();
        $item_count = 0;
        $rss = Load_RSS_data();
    Severity: Minor
    Found in lib/rss.php by phpmd

    Since: PHPMD 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: http://phpmd.org/rules/controversial.txt

    The variable $rss_header is not named in camelCase.
    Open

    function RSS_header()
    {
        
        $rss_header = '<?xml version="1.0"?>
        <rss version="2.0">
    Severity: Minor
    Found in lib/rss.php by phpmd

    Since: PHPMD 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: http://phpmd.org/rules/controversial.txt

    The variable $new_rss is not named in camelCase.
    Open

    function Add_Rss_item($item_array = null)
    {
        $new_rss = RSS_header();
        $item_count = 0;
        $rss = Load_RSS_data();
    Severity: Minor
    Found in lib/rss.php by phpmd

    Since: PHPMD 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: http://phpmd.org/rules/controversial.txt

    The variable $new_rss is not named in camelCase.
    Open

    function Add_Rss_item($item_array = null)
    {
        $new_rss = RSS_header();
        $item_count = 0;
        $rss = Load_RSS_data();
    Severity: Minor
    Found in lib/rss.php by phpmd

    Since: PHPMD 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: http://phpmd.org/rules/controversial.txt

    The variable $new_rss is not named in camelCase.
    Open

    function Delete_Oldest_rss($max_items='20')
    {
        $new_rss = RSS_header();
        $item_count = 0;
        $rss = Load_RSS_data();
    Severity: Minor
    Found in lib/rss.php by phpmd

    Since: PHPMD 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: http://phpmd.org/rules/controversial.txt

    The variable $item_array is not named in camelCase.
    Open

    function Add_Rss_item($item_array = null)
    {
        $new_rss = RSS_header();
        $item_count = 0;
        $rss = Load_RSS_data();
    Severity: Minor
    Found in lib/rss.php by phpmd

    Since: PHPMD 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: http://phpmd.org/rules/controversial.txt

    The variable $rss_header is not named in camelCase.
    Open

    function RSS_header()
    {
        
        $rss_header = '<?xml version="1.0"?>
        <rss version="2.0">
    Severity: Minor
    Found in lib/rss.php by phpmd

    Since: PHPMD 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: http://phpmd.org/rules/controversial.txt

    The variable $rss_header is not named in camelCase.
    Open

    function RSS_header()
    {
        
        $rss_header = '<?xml version="1.0"?>
        <rss version="2.0">
    Severity: Minor
    Found in lib/rss.php by phpmd

    Since: PHPMD 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: http://phpmd.org/rules/controversial.txt

    The variable $item_count is not named in camelCase.
    Open

    function Delete_Oldest_rss($max_items='20')
    {
        $new_rss = RSS_header();
        $item_count = 0;
        $rss = Load_RSS_data();
    Severity: Minor
    Found in lib/rss.php by phpmd

    Since: PHPMD 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: http://phpmd.org/rules/controversial.txt

    The variable $max_items is not named in camelCase.
    Open

    function Delete_Oldest_rss($max_items='20')
    {
        $new_rss = RSS_header();
        $item_count = 0;
        $rss = Load_RSS_data();
    Severity: Minor
    Found in lib/rss.php by phpmd

    Since: PHPMD 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: http://phpmd.org/rules/controversial.txt

    The variable $new_rss is not named in camelCase.
    Open

    function Add_Rss_item($item_array = null)
    {
        $new_rss = RSS_header();
        $item_count = 0;
        $rss = Load_RSS_data();
    Severity: Minor
    Found in lib/rss.php by phpmd

    Since: PHPMD 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: http://phpmd.org/rules/controversial.txt

    The variable $new_rss is not named in camelCase.
    Open

    function Delete_Oldest_rss($max_items='20')
    {
        $new_rss = RSS_header();
        $item_count = 0;
        $rss = Load_RSS_data();
    Severity: Minor
    Found in lib/rss.php by phpmd

    Since: PHPMD 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: http://phpmd.org/rules/controversial.txt

    The variable $new_rss is not named in camelCase.
    Open

    function Delete_Oldest_rss($max_items='20')
    {
        $new_rss = RSS_header();
        $item_count = 0;
        $rss = Load_RSS_data();
    Severity: Minor
    Found in lib/rss.php by phpmd

    Since: PHPMD 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: http://phpmd.org/rules/controversial.txt

    The variable $new_rss is not named in camelCase.
    Open

    function Delete_Oldest_rss($max_items='20')
    {
        $new_rss = RSS_header();
        $item_count = 0;
        $rss = Load_RSS_data();
    Severity: Minor
    Found in lib/rss.php by phpmd

    Since: PHPMD 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: http://phpmd.org/rules/controversial.txt

    The variable $new_rss is not named in camelCase.
    Open

    function Add_Rss_item($item_array = null)
    {
        $new_rss = RSS_header();
        $item_count = 0;
        $rss = Load_RSS_data();
    Severity: Minor
    Found in lib/rss.php by phpmd

    Since: PHPMD 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: http://phpmd.org/rules/controversial.txt

    The variable $item_count is not named in camelCase.
    Open

    function Add_Rss_item($item_array = null)
    {
        $new_rss = RSS_header();
        $item_count = 0;
        $rss = Load_RSS_data();
    Severity: Minor
    Found in lib/rss.php by phpmd

    Since: PHPMD 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: http://phpmd.org/rules/controversial.txt

    The variable $new_rss is not named in camelCase.
    Open

    function Add_Rss_item($item_array = null)
    {
        $new_rss = RSS_header();
        $item_count = 0;
        $rss = Load_RSS_data();
    Severity: Minor
    Found in lib/rss.php by phpmd

    Since: PHPMD 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: http://phpmd.org/rules/controversial.txt

    The variable $rss_header is not named in camelCase.
    Open

    function RSS_header()
    {
        
        $rss_header = '<?xml version="1.0"?>
        <rss version="2.0">
    Severity: Minor
    Found in lib/rss.php by phpmd

    Since: PHPMD 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: http://phpmd.org/rules/controversial.txt

    The variable $item_count is not named in camelCase.
    Open

    function Delete_Oldest_rss($max_items='20')
    {
        $new_rss = RSS_header();
        $item_count = 0;
        $rss = Load_RSS_data();
    Severity: Minor
    Found in lib/rss.php by phpmd

    Since: PHPMD 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: http://phpmd.org/rules/controversial.txt

    The variable $item_count is not named in camelCase.
    Open

    function Add_Rss_item($item_array = null)
    {
        $new_rss = RSS_header();
        $item_count = 0;
        $rss = Load_RSS_data();
    Severity: Minor
    Found in lib/rss.php by phpmd

    Since: PHPMD 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: http://phpmd.org/rules/controversial.txt

    The variable $new_rss is not named in camelCase.
    Open

    function Add_Rss_item($item_array = null)
    {
        $new_rss = RSS_header();
        $item_count = 0;
        $rss = Load_RSS_data();
    Severity: Minor
    Found in lib/rss.php by phpmd

    Since: PHPMD 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: http://phpmd.org/rules/controversial.txt

    The variable $new_rss is not named in camelCase.
    Open

    function Delete_Oldest_rss($max_items='20')
    {
        $new_rss = RSS_header();
        $item_count = 0;
        $rss = Load_RSS_data();
    Severity: Minor
    Found in lib/rss.php by phpmd

    Since: PHPMD 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: http://phpmd.org/rules/controversial.txt

    The variable $new_rss is not named in camelCase.
    Open

    function Add_Rss_item($item_array = null)
    {
        $new_rss = RSS_header();
        $item_count = 0;
        $rss = Load_RSS_data();
    Severity: Minor
    Found in lib/rss.php by phpmd

    Since: PHPMD 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: http://phpmd.org/rules/controversial.txt

    There are no issues that match your filters.

    Category
    Status