Showing 12 of 32 total issues
Method make
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function make($config = null)
{
$start = (int) $this->_containerGet($config, 'start');
$end = (int) $this->_containerGet($config, 'end');
$resourceIds = $this->_containerGet($config, 'resource_ids');
Function _generateForService
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
protected function _generateForService($service)
{
// Get the service's schedule availability, since service availability it saved in its schedule
$scheduleId = $this->_containerGet($service, 'schedule_id');
$schedule = $this->resourcesManager->get($scheduleId);
- 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 _generateForService
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _generateForService($service)
{
// Get the service's schedule availability, since service availability it saved in its schedule
$scheduleId = $this->_containerGet($service, 'schedule_id');
$schedule = $this->resourcesManager->get($scheduleId);
Function make
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function make($config = null)
{
$start = (int) $this->_containerGet($config, 'start');
$end = (int) $this->_containerGet($config, 'end');
$resourceIds = $this->_containerGet($config, 'resource_ids');
- 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 8 arguments (exceeds 4 allowed). Consider refactoring. Open
SessionGeneratorInterface $generator,
EntityManagerInterface $servicesManager,
GetCapableManagerInterface $resourcesManager,
FactoryInterface $sessionTypeFactory,
FactoryInterface $availabilityFactory,
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
$periodFactory,
$start,
$end,
$repeatFreq = null,
$repeatEnd = null,
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
$key,
$dependencies,
$configFactory,
$containerFactory,
$compContainerFactory,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$periodFactory,
$start,
$end,
$repeatFreq = null,
$repeatEnd = null,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$periodFactory,
$start,
$end,
$repeatFreq = null,
$repeatEnd = null,
Method _initRule
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$periodFactory,
$start,
$end,
$repeatFreq = null,
$repeatEnd = null,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$periodFactory,
$start,
$end,
$repeatFreq = null,
$repeatEnd = null,
Function _getServicesForResource
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function _getServicesForResource($resourceId)
{
$results = [];
$services = $this->servicesManager->query();
- 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"