mambax7/cardealer

View on GitHub
class/Form/ServpartForm.php

Summary

Maintainability
A
0 mins
Test Coverage

Missing class import via use statement (line '84', column '31').
Open

        $this->addElement(new \XoopsFormHidden('op', 'save'));
Severity: Minor
Found in class/Form/ServpartForm.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '78', column '34').
Open

        $service_id_select = new \XoopsFormSelect(AM_CARDEALER_SERVPART_ITEMNUM, 'itemnum', $this->targetObject->getVar('itemnum'));
Severity: Minor
Found in class/Form/ServpartForm.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '59', column '23').
Open

        $hidden = new \XoopsFormHidden('id', $this->targetObject->getVar('id'));
Severity: Minor
Found in class/Form/ServpartForm.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '70', column '31').
Open

        $part_id_select = new \XoopsFormSelect(AM_CARDEALER_SERVPART_PARTNUM, 'partnum', $this->targetObject->getVar('partnum'));
Severity: Minor
Found in class/Form/ServpartForm.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '64', column '31').
Open

        $this->addElement(new \XoopsFormLabel(AM_CARDEALER_SERVPART_ID, $this->targetObject->getVar('id'), 'id'));
Severity: Minor
Found in class/Form/ServpartForm.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '82', column '31').
Open

        $this->addElement(new \XoopsFormText(AM_CARDEALER_SERVPART_QUANTITY, 'quantity', 50, 255, $this->targetObject->getVar('quantity')), false);
Severity: Minor
Found in class/Form/ServpartForm.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '85', column '31').
Open

        $this->addElement(new \XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
Severity: Minor
Found in class/Form/ServpartForm.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Avoid using static access to class '\XoopsDatabaseFactory' in method '__construct'.
Open

        $db = \XoopsDatabaseFactory::getDatabaseConnection();
Severity: Minor
Found in class/Form/ServpartForm.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\XoopsDatabaseFactory' in method '__construct'.
Open

        $db = \XoopsDatabaseFactory::getDatabaseConnection();
Severity: Minor
Found in class/Form/ServpartForm.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

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

        global $helper;
Severity: Minor
Found in class/Form/ServpartForm.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

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

        $db = \XoopsDatabaseFactory::getDatabaseConnection();
Severity: Minor
Found in class/Form/ServpartForm.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

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

<?php namespace XoopsModules\Cardealer\Form;
Severity: Minor
Found in class/Form/ServpartForm.php by phpcodesniffer

Line exceeds 120 characters; contains 129 characters
Open

        $part_id_select = new \XoopsFormSelect(AM_CARDEALER_SERVPART_PARTNUM, 'partnum', $this->targetObject->getVar('partnum'));
Severity: Minor
Found in class/Form/ServpartForm.php by phpcodesniffer

Line exceeds 120 characters; contains 121 characters
Open

        $title = $this->targetObject->isNew() ? sprintf(AM_CARDEALER_SERVPART_ADD) : sprintf(AM_CARDEALER_SERVPART_EDIT);
Severity: Minor
Found in class/Form/ServpartForm.php by phpcodesniffer

Line exceeds 120 characters; contains 147 characters
Open

        $this->addElement(new \XoopsFormText(AM_CARDEALER_SERVPART_QUANTITY, 'quantity', 50, 255, $this->targetObject->getVar('quantity')), false);
Severity: Minor
Found in class/Form/ServpartForm.php by phpcodesniffer

Line exceeds 120 characters; contains 132 characters
Open

        $service_id_select = new \XoopsFormSelect(AM_CARDEALER_SERVPART_ITEMNUM, 'itemnum', $this->targetObject->getVar('itemnum'));
Severity: Minor
Found in class/Form/ServpartForm.php by phpcodesniffer

The variable $service_id_select is not named in camelCase.
Open

    public function __construct($target)
    {
        global $helper;
        $this->targetObject = $target;

Severity: Minor
Found in class/Form/ServpartForm.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 $part_id_select is not named in camelCase.
Open

    public function __construct($target)
    {
        global $helper;
        $this->targetObject = $target;

Severity: Minor
Found in class/Form/ServpartForm.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 $part_id_select is not named in camelCase.
Open

    public function __construct($target)
    {
        global $helper;
        $this->targetObject = $target;

Severity: Minor
Found in class/Form/ServpartForm.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 $service_id_select is not named in camelCase.
Open

    public function __construct($target)
    {
        global $helper;
        $this->targetObject = $target;

Severity: Minor
Found in class/Form/ServpartForm.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 $service_id_select is not named in camelCase.
Open

    public function __construct($target)
    {
        global $helper;
        $this->targetObject = $target;

Severity: Minor
Found in class/Form/ServpartForm.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 $part_id_select is not named in camelCase.
Open

    public function __construct($target)
    {
        global $helper;
        $this->targetObject = $target;

Severity: Minor
Found in class/Form/ServpartForm.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