Showing 13 of 41 total issues
File config.php
has 339 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
return [
'wp_bookings_ui' => [
'wp_rest_api_nonce' => 'wp_rest',
File WpBookingsUiModule.php
has 291 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace RebelCode\Bookings\WordPress\Module;
use Dhii\Data\Container\ContainerFactoryInterface;
Method _adminMenu
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _adminMenu($c)
{
$rootMenuConfig = $c->get('wp_bookings_ui/menu/root');
$servicesMenuConfig = $c->get('wp_bookings_ui/menu/services');
$staffMembersMenuConfig = $c->get('wp_bookings_ui/menu/staff_members');
Method __construct
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
$settingsContainer,
$statuses,
$statusesLabels,
$currencyConfig,
$formatsConfig,
Method _enqueueAssets
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _enqueueAssets(ContainerInterface $assetsUrlMap, ContainerInterface $c)
{
if (!$this->_isOnAppPage()) {
return;
}
Function _enqueueAssets
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function _enqueueAssets(ContainerInterface $assetsUrlMap, ContainerInterface $c)
{
if (!$this->_isOnAppPage()) {
return;
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
$statuses,
$screenOptionsKey,
$screenOptionsFields,
$screenOptionsEndpoint,
$screenOptionsCache,
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
$key,
$dependencies,
$configFactory,
$containerFactory,
$compContainerFactory,
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($settingsContainer, $fieldsOptions, $fields, $updateEndpoint, $defaultWizardLabels)
Method _getUiConfig
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function _getUiConfig($currencyConfig, $formatsConfig, $linksConfig, $uiActionsConfig, $validatorsConfig)
Function _prepareEndpoints
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function _prepareEndpoints($endpointsConfig)
{
$resultingConfig = [];
foreach ($endpointsConfig as $namespace => $endpoints) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _iteratorToArrayRecursive
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function _iteratorToArrayRecursive($iterator, $transformer = null)
{
$iterator = $this->_normalizeIterable($iterator);
$array = [];
foreach ($iterator as $key => $value) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _getWebsiteTimezone
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function _getWebsiteTimezone()
{
$currentOffset = get_option('gmt_offset');
$tzstring = get_option('timezone_string');
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"