attogram/attogram-info

View on GitHub
admin_actions/info.php

Summary

Maintainability
A
3 hrs
Test Coverage

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

    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

    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

    $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

    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

    $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

    Variable $this is undeclared
    Open

    $info['projectRepository'] = '<a href="'.$this->projectRepository.'">'
    Severity: Minor
    Found in admin_actions/info.php by phan

    Variable $this is undeclared
    Open

    $info['siteUrl'] = '<a href="'.$this->getSiteUrl().'">'
    Severity: Minor
    Found in admin_actions/info.php by phan

    Variable $this is undeclared
    Open

    $info['IP'] = $this->clientIp;
    Severity: Minor
    Found in admin_actions/info.php by phan

    Variable $this is undeclared
    Open

      .$this->projectRepository.'</a>';
    Severity: Minor
    Found in admin_actions/info.php by phan

    Variable $this is undeclared
    Open

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

    Variable $this is undeclared
    Open

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

    Variable $this is undeclared
    Open

    $this->pageHeader($title);
    Severity: Minor
    Found in admin_actions/info.php by phan

    Variable $this is undeclared
    Open

      .$this->getSiteUrl().'</a>';
    Severity: Minor
    Found in admin_actions/info.php by phan

    Variable $this is undeclared
    Open

    $info['path'] = ($this->path ? $this->path : '<code>Top Level</code>');
    Severity: Minor
    Found in admin_actions/info.php by phan

    Variable $this is undeclared
    Open

    $robotstxt = $this->getSiteUrl().'/robots.txt';
    Severity: Minor
    Found in admin_actions/info.php by phan

    Variable $this is undeclared
    Open

    $this->pageFooter();
    Severity: Minor
    Found in admin_actions/info.php by phan

    Variable $this is undeclared
    Open

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

    Reference to constant ATTOGRAM_VERSION from undeclared class \Attogram\self
    Open

    $info['Attogram Version'] = self::ATTOGRAM_VERSION;
    Severity: Critical
    Found in admin_actions/info.php by phan

    Variable $this is undeclared
    Open

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

    Variable $this is undeclared
    Open

    $info['database_size'] = (file_exists($this->config['databaseName'])
    Severity: Minor
    Found in admin_actions/info.php by phan

    Variable $this is undeclared
    Open

    $info['Server Software'] = $this->request->server->get('SERVER_SOFTWARE');
    Severity: Minor
    Found in admin_actions/info.php by phan

    Variable $this is undeclared
    Open

      ? filesize($this->config['databaseName']) : '<code>null</code>').' bytes';
    Severity: Minor
    Found in admin_actions/info.php by phan

    Variable $this is undeclared
    Open

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

    Variable $this is undeclared
    Open

    $sitemapxml = $this->getSiteUrl().'/sitemap.xml';
    Severity: Minor
    Found in admin_actions/info.php by phan

    Variable $this is undeclared
    Open

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

    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

    There are no issues that match your filters.

    Category
    Status