Showing 23 of 47 total issues
File config.php
has 384 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/*
* ************** CAUTION **************
*
Method getConfigTreeBuilder
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('veslo_anthill');
RawDto
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class RawDto
{
/**
* Vacancy URL
*
HeadHunter
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class HeadHunter implements ParametersInterface
{
/**
* DateTime format
*
Method getConfigTreeBuilder
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('veslo_app');
Method load
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function load(array $configs, ContainerBuilder $container)
{
$locator = new FileLocator(__DIR__ . implode(DIRECTORY_SEPARATOR, ['', '..', 'Resources']));
$loader = new YamlFileLoader($container, $locator);
Method getHttpProxyNode
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getHttpProxyNode(): ArrayNodeDefinition
{
$treeBuilder = new TreeBuilder();
$node = $treeBuilder->root('proxy');
Method load
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function load(array $configs, ContainerBuilder $container)
{
$locator = new FileLocator(__DIR__ . implode(DIRECTORY_SEPARATOR, ['', '..', 'Resources']));
$loader = new YamlFileLoader($container, $locator);
Method collectIteration
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function collectIteration(PitInterface $pit): bool
{
$sourceName = get_class($pit);
/** @var ParsedDto $scanResult */
Method appendTo
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function appendTo(ItemInterface $root, Category $category): ItemInterface
{
$categoryName = $category->getName();
$categoryMenuItemOptions = [
Method iAmCurious
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function iAmCurious(HeadHunterParameters $parameters, int $page = 0): array
{
$uri = $parameters->getUrl();
$query = [
'text' => $parameters->getText(),
Method getAmqpClientNode
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getAmqpClientNode(): ArrayNodeDefinition
{
$treeBuilder = new TreeBuilder();
$node = $treeBuilder->root('amqp_client');
Method getConfigTreeBuilder
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('veslo_sanity');
Method load
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function load(array $configs, ContainerBuilder $container)
{
$locator = new FileLocator(__DIR__ . implode(DIRECTORY_SEPARATOR, ['', '..', 'Resources']));
$loader = new YamlFileLoader($container, $locator);
Method deliverIteration
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function deliverIteration(PitInterface $pit): bool
{
$sourceName = get_class($pit);
/** @var AcceptanceDto $acceptance */
Method distribute
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function distribute(Payload $payload, array $queueNames): void
{
$this->ensureConnection();
$channel = $this->amqpClient->channel();
Function execute
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public function execute(PitInterface $source, int $iterations): int
{
$iterationRemains = max(1, $iterations);
$iterationSuccess = 0;
$iterationClosure = $this->iteration;
- 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 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
LoggerInterface $logger,
VacancyRepository $vacancyRepository,
AnalyserInterface $vacancyAnalyser,
IndexCreator $sanityIndexCreator,
NormalizerInterface $sanityIndexNormalizer
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
EngineInterface $templateEngine,
Journal $vacancyJournal,
Archive $vacancyArchive,
IndexRepository $indexRepository,
TranslatorInterface $translator
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
ClientInterface $motClient,
CredentialsStorageInterface $credentialsStorage,
DataConverter $dataConverter,
AdapterInterface $cache,
array $options