XoopsModules25x/apcal

View on GitHub
getevents.php

Summary

Maintainability
A
0 mins
Test Coverage

__construct accesses the super-global variable $GLOBALS.
Open

    public function __construct()
    {
        include XOOPS_ROOT_PATH . '/modules/apcal/language/' . $GLOBALS['xoopsConfig']['language'] . '/apcal_vars.phtml';
    }
Severity: Minor
Found in getevents.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

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

class apcal_locale
Severity: Minor
Found in getevents.php by phpcodesniffer

The property $date_long_names is not named in camelCase.
Open

class apcal_locale
{
    public $hour_names_24;
    public $hour_names_12;
    public $holidays;
Severity: Minor
Found in getevents.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The property $hour_names_24 is not named in camelCase.
Open

class apcal_locale
{
    public $hour_names_24;
    public $hour_names_12;
    public $holidays;
Severity: Minor
Found in getevents.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The property $hour_names_12 is not named in camelCase.
Open

class apcal_locale
{
    public $hour_names_24;
    public $hour_names_12;
    public $holidays;
Severity: Minor
Found in getevents.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

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

    global $l;
Severity: Minor
Found in getevents.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 property $date_short_names is not named in camelCase.
Open

class apcal_locale
{
    public $hour_names_24;
    public $hour_names_12;
    public $holidays;
Severity: Minor
Found in getevents.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The property $month_short_names is not named in camelCase.
Open

class apcal_locale
{
    public $hour_names_24;
    public $hour_names_12;
    public $holidays;
Severity: Minor
Found in getevents.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The property $week_long_names is not named in camelCase.
Open

class apcal_locale
{
    public $hour_names_24;
    public $hour_names_12;
    public $holidays;
Severity: Minor
Found in getevents.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The class apcal_locale is not named in CamelCase.
Open

class apcal_locale
{
    public $hour_names_24;
    public $hour_names_12;
    public $holidays;
Severity: Minor
Found in getevents.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

The property $week_numbers is not named in camelCase.
Open

class apcal_locale
{
    public $hour_names_24;
    public $hour_names_12;
    public $holidays;
Severity: Minor
Found in getevents.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The property $month_middle_names is not named in camelCase.
Open

class apcal_locale
{
    public $hour_names_24;
    public $hour_names_12;
    public $holidays;
Severity: Minor
Found in getevents.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The property $week_short_names is not named in camelCase.
Open

class apcal_locale
{
    public $hour_names_24;
    public $hour_names_12;
    public $holidays;
Severity: Minor
Found in getevents.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The property $week_middle_names is not named in camelCase.
Open

class apcal_locale
{
    public $hour_names_24;
    public $hour_names_12;
    public $holidays;
Severity: Minor
Found in getevents.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The property $month_long_names is not named in camelCase.
Open

class apcal_locale
{
    public $hour_names_24;
    public $hour_names_12;
    public $holidays;
Severity: Minor
Found in getevents.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The property $byday2langday_w is not named in camelCase.
Open

class apcal_locale
{
    public $hour_names_24;
    public $hour_names_12;
    public $holidays;
Severity: Minor
Found in getevents.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The property $byday2langday_m is not named in camelCase.
Open

class apcal_locale
{
    public $hour_names_24;
    public $hour_names_12;
    public $holidays;
Severity: Minor
Found in getevents.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

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

<?php
Severity: Minor
Found in getevents.php by phpcodesniffer

Only one argument is allowed per line in a multi-line function call
Open

                        ENT_QUOTES, 'UTF-8') : '';
Severity: Minor
Found in getevents.php by phpcodesniffer

Line exceeds 120 characters; contains 121 characters
Open

        include XOOPS_ROOT_PATH . '/modules/apcal/language/' . $GLOBALS['xoopsConfig']['language'] . '/apcal_vars.phtml';
Severity: Minor
Found in getevents.php by phpcodesniffer

Line exceeds 120 characters; contains 160 characters
Open

    $row['link']    = $xoopsModuleConfig['apcal_useurlrewrite'] ? XOOPS_URL . '/modules/apcal/' . $row['shortsummary'] . '-' . date('j-n-Y', $start) : XOOPS_URL
Severity: Minor
Found in getevents.php by phpcodesniffer

Line exceeds 120 characters; contains 180 characters
Open

                                                                                                                                                       . '/modules/apcal/?event_id='
Severity: Minor
Found in getevents.php by phpcodesniffer

Line exceeds 120 characters; contains 164 characters
Open

                                                                                                                                                       . $row['id'];
Severity: Minor
Found in getevents.php by phpcodesniffer

Line exceeds 120 characters; contains 215 characters
Open

$result  = $GLOBALS['xoopsDB']->queryF("SELECT id, start, end, summary, shortsummary FROM {$GLOBALS['xoopsDB']->prefix('apcal_event')} WHERE {$catcrit} end>UNIX_TIMESTAMP() ORDER BY start ASC LIMIT 0,{$_GET['n']}");
Severity: Minor
Found in getevents.php by phpcodesniffer

Line exceeds 120 characters; contains 198 characters
Open

     > 0 ? htmlentities($GLOBALS['xoopsDB']->fetchObject($GLOBALS['xoopsDB']->queryF("SELECT cat_title FROM {$GLOBALS['xoopsDB']->prefix('apcal_cat')} WHERE cid={$_GET['c']} LIMIT 0,1"))->cat_title,
Severity: Minor
Found in getevents.php by phpcodesniffer

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

     > 0 ? htmlentities($GLOBALS['xoopsDB']->fetchObject($GLOBALS['xoopsDB']->queryF("SELECT cat_title FROM {$GLOBALS['xoopsDB']->prefix('apcal_cat')} WHERE cid={$_GET['c']} LIMIT 0,1"))->cat_title,
Severity: Minor
Found in getevents.php by phpcodesniffer

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

                        ENT_QUOTES, 'UTF-8') : '';
Severity: Minor
Found in getevents.php by phpcodesniffer

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

class apcal_locale
Severity: Minor
Found in getevents.php by phpcodesniffer

Multi-line function call not indented correctly; expected 5 spaces but found 24
Open

                        ENT_QUOTES, 'UTF-8') : '';
Severity: Minor
Found in getevents.php by phpcodesniffer

There are no issues that match your filters.

Category
Status