common/migrations/db/m160213_224424_add_product_unit_table.php
Method up
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function up()
{
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
Missing class import via use statement (line '31', column '49'). Open
Open
[uniqid('', true), 'ml', 1, new \yii\db\Expression('NOW()')],
- Read upRead up
- Exclude checks
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 '32', column '51'). Open
Open
[uniqid('', true), 'item', 1, new \yii\db\Expression('NOW()')],
- Read upRead up
- Exclude checks
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 '28', column '49'). Open
Open
[uniqid('', true), 'kg', 1, new \yii\db\Expression('NOW()')],
- Read upRead up
- Exclude checks
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 '30', column '48'). Open
Open
[uniqid('', true), 'l', 1, new \yii\db\Expression('NOW()')],
- Read upRead up
- Exclude checks
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 '29', column '48'). Open
Open
[uniqid('', true), 'g', 1, new \yii\db\Expression('NOW()')],
- Read upRead up
- Exclude checks
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 short method names like m160213_224424_add_product_unit_table::up(). The configured minimum method name length is 3. Open
Open
public function up()
{
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
- Read upRead up
- Exclude checks
ShortMethodName
Since: 0.2
Detects when very short method names are used.
Example
class ShortMethod {
public function a( $index ) { // Violation
}
}
Source https://phpmd.org/rules/naming.html#shortmethodname
The class m160213_224424_add_product_unit_table is not named in CamelCase. Open
Open
class m160213_224424_add_product_unit_table extends Migration
{
public function up()
{
$tableOptions = null;
- Read upRead up
- Exclude checks
CamelCaseClassName
Since: 0.2
It is considered best practice to use the CamelCase notation to name classes.
Example
class class_name {
}