attogram/attogram-info

View on GitHub

Showing 46 of 46 total issues

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

function info_actions($actions, $depths = array(), $endslashs = array())
{
    $result = '';
    if (!isset($depths[''])) {
        $depths[''] = '<code>ERROR</code>';  // homepage
Severity: Minor
Found in admin_actions/info.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 info_actions has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function info_actions($actions, $depths = array(), $endslashs = array())
{
    $result = '';
    if (!isset($depths[''])) {
        $depths[''] = '<code>ERROR</code>';  // homepage
Severity: Minor
Found in admin_actions/info.php - About 1 hr to fix

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

    class BaseTest extends PHPUnit\Framework\TestCase
    Severity: Minor
    Found in tests/BaseTest.php by phpcodesniffer

    Function info_array has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    function info_array($array, $keyed = false)
    {
        if (!is_array($array)) {
            return '<code>ERROR</code>';
        }
    Severity: Minor
    Found in admin_actions/info.php - About 55 mins 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

    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 86 and the first side effect is on line 6.
    Open

    <?php
    Severity: Minor
    Found in admin_actions/info.php by phpcodesniffer

    Variable $this is undeclared
    Open

    $info['Attogram Directory'] = info_dir($this->attogramDirectory);
    Severity: Minor
    Found in admin_actions/info.php by phan

    Variable $this is undeclared
    Open

    $info['templates'] = info_array($this->templates, true);
    Severity: Minor
    Found in admin_actions/info.php by phan

    Variable $this is undeclared
    Open

        $this
    Severity: Minor
    Found in actions/changelog.php by phan

    Variable $this is undeclared
    Open

        $this->attogramDirectory.'LICENSE.md',
    Severity: Minor
    Found in actions/license.php by phan

    Variable $this is undeclared
    Open

    $info['log'] = info_object($this->log);
    Severity: Minor
    Found in admin_actions/info.php by phan

    Variable $this is undeclared
    Open

    $info['db'] = info_object($this->database);
    Severity: Minor
    Found in admin_actions/info.php by phan

    Possibly zero references to use statement for classlike/namespace TestCase (\PHPUnit\Framework\TestCase)
    Open

    use PHPUnit\Framework\TestCase;
    Severity: Minor
    Found in tests/BaseTest.php by phan

    Class extends undeclared class \PHPUnit\Framework\TestCase
    Open

    class BaseTest extends PHPUnit\Framework\TestCase
    Severity: Critical
    Found in tests/BaseTest.php by phan

    TODO found
    Open

    # TODO: [Attogram Framework Info Module](https://github.com/attogram/attogram-info)
    Severity: Minor
    Found in TODO.md by fixme

    Variable $this is undeclared
    Open

    $info['config'] = info_array($this->config, true);
    Severity: Minor
    Found in admin_actions/info.php by phan

    Variable $this is undeclared
    Open

        $this->attogramDirectory.'README.md',
    Severity: Minor
    Found in actions/readme.php by phan

    Variable $this is undeclared
    Open

    $info['actions'] = info_actions($this->actions, $this->depth, $this->noEndSlash);
    Severity: Minor
    Found in admin_actions/info.php by phan

    Variable $this is undeclared
    Open

    $info['skip_files'] = info_array($this->getSkipFiles());
    Severity: Minor
    Found in admin_actions/info.php by phan

    Variable $this is undeclared
    Open

    $info['event'] = info_object($this->event);
    Severity: Minor
    Found in admin_actions/info.php by phan

    Variable $this is undeclared
    Open

    $info['request'] = info_object($this->request);
    Severity: Minor
    Found in admin_actions/info.php by phan
    Severity
    Category
    Status
    Source
    Language