XoopsModules25x/apcal

View on GitHub
shareCalendar.php

Summary

Maintainability
A
0 mins
Test Coverage

getCategories accesses the super-global variable $GLOBALS.
Open

function getCategories()
{
    global $xoopsDB;

    $cats   = array(0 => _APCAL_SHOWALLCAT);
Severity: Minor
Found in shareCalendar.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

getCategories accesses the super-global variable $GLOBALS.
Open

function getCategories()
{
    global $xoopsDB;

    $cats   = array(0 => _APCAL_SHOWALLCAT);
Severity: Minor
Found in shareCalendar.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

getCategories accesses the super-global variable $GLOBALS.
Open

function getCategories()
{
    global $xoopsDB;

    $cats   = array(0 => _APCAL_SHOWALLCAT);
Severity: Minor
Found in shareCalendar.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

Avoid unused local variables such as '$xoopsDB'.
Open

    global $xoopsDB;
Severity: Minor
Found in shareCalendar.php by phpmd

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

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

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

Line exceeds 120 characters; contains 124 characters
Open

$formCustom->addElement(new XoopsFormText(_APCAL_LINK, 'APlink', 60, 255, 'color: #0000FF; text-decoration: none;'), false);
Severity: Minor
Found in shareCalendar.php by phpcodesniffer

Line exceeds 120 characters; contains 121 characters
Open

$formCustom->addElement(new XoopsFormText(_APCAL_TITLE, 'APtitle', 60, 255, 'color: #000000; font-size: 1.3em;'), false);
Severity: Minor
Found in shareCalendar.php by phpcodesniffer

Line exceeds 120 characters; contains 142 characters
Open

    $result = $GLOBALS['xoopsDB']->queryF("SELECT cid, cat_title, cat_depth FROM {$GLOBALS['xoopsDB']->prefix('apcal_cat')} ORDER BY weight");
Severity: Minor
Found in shareCalendar.php by phpcodesniffer

The variable $depth_desc is not named in camelCase.
Open

function getCategories()
{
    global $xoopsDB;

    $cats   = array(0 => _APCAL_SHOWALLCAT);
Severity: Minor
Found in shareCalendar.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 $depth_desc is not named in camelCase.
Open

function getCategories()
{
    global $xoopsDB;

    $cats   = array(0 => _APCAL_SHOWALLCAT);
Severity: Minor
Found in shareCalendar.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