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 clauses are basically not necessary and you can simplify the code by not using them.
    Open

        } else {
            return 'Failed to load RSS';
        }
    Severity: Minor
    Found in lib/rss.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 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

    ExitExpression

    Since: 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 https://phpmd.org/rules/design.html#exitexpression

    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

    CamelCaseParameterName

    Since: 0.2

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

    Example

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

    Source

    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

    CamelCaseParameterName

    Since: 0.2

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

    Example

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

    Source

    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

    ShortVariable

    Since: 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 https://phpmd.org/rules/naming.html#shortvariable

    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

    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 $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

    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 $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

    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 $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

    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 $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

    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 $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

    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 $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

    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 $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

    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 $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

    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 $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

    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 $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

    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 $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

    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 $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

    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 $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

    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 $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

    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 $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

    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 $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

    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 $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

    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 $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

    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 $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

    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 $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

    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 $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

    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 $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

    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 $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

    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