Showing 63 of 63 total issues
Method setup
has 401 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setup()
{
return $this->_setupContainer(
$this->_loadPhpConfigFile(RC_WP_BOOKINGS_CQRS_MODULE_CONFIG_FILE),
[
File WpBookingsCqrsModule.php
has 456 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace RebelCode\Storage\Resource\WordPress\Module;
use Dhii\Config\ConfigFactoryInterface;
File ResourcesEntityManager.php
has 311 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace RebelCode\Storage\Resource\WordPress;
use ArrayAccess;
ResourcesEntityManager
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class ResourcesEntityManager extends BaseCqrsEntityManager
{
/* @since [*next-version*] */
use ContainerGetPathCapableTrait;
Similar blocks of code found in 3 locations. Consider refactoring. Open
<?php
return [
// Config for all resource RMs
'table' => '${cqrs/table_prefix}resources',
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 129.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
<?php
return [
// Config for all session RMs
'table' => '${cqrs/table_prefix}sessions',
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 129.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
<?php
return [
// Config for all transition log RMs
'table' => '${cqrs/table_prefix}transition_logs',
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 129.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Method _updateSessionRules
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _updateSessionRules($id, $data)
{
$b = $this->exprBuilder;
try {
Method __construct
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
SelectCapableInterface $selectRm,
InsertCapableInterface $insertRm,
UpdateCapableInterface $updateRm,
DeleteCapableInterface $deleteRm,
SelectCapableInterface $rulesSelectRm,
Method _processSessionRuleData
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _processSessionRuleData($resourceId, $ruleData, $serviceTz)
{
$allDay = $this->_containerGet($ruleData, 'isAllDay');
// Parse the service timezone name into a timezone object
Avoid using undefined variables such as '$c' which will lead to PHP notices. Open
$option = $c->get('wp_bookings_cqrs/migrations/db_version_option');
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
wpdb $wpdb,
TemplateInterface $expressionTemplate,
MapFactoryInterface $factory,
$tables,
$fieldColumnMap,
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
wpdb $wpdb,
TemplateInterface $template,
MapFactoryInterface $mapFactory,
$tables,
$fieldColumnMap,
Method __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
SelectCapableInterface $selectRm,
InsertCapableInterface $insertRm,
UpdateCapableInterface $updateRm,
DeleteCapableInterface $deleteRm,
InsertCapableInterface $bkResourcesInsertRm,
Method __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
wpdb $wpdb,
TemplateInterface $expressionTemplate,
MapFactoryInterface $factory,
$tables,
$fieldColumnMap,
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
wpdb $wpdb,
TemplateInterface $expressionTemplate,
MapFactoryInterface $mapFactory,
$tables,
$fieldColumnMap,
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
$key,
$dependencies,
ConfigFactoryInterface $configFactory,
ContainerFactoryInterface $containerFactory,
ContainerFactoryInterface $compContainerFactory,
Avoid variables with short names like $id. Configured minimum length is 3. Open
protected function _createResourceIdExpression($id)
- Read upRead up
- Exclude checks
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
Avoid variables with short names like $t. Configured minimum length is 3. Open
$t = [];
- Read upRead up
- Exclude checks
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
Avoid variables with short names like $b. Configured minimum length is 3. Open
$b = $this->exprBuilder;
- Read upRead up
- Exclude checks
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;
}
}
}