Showing 10 of 10 total issues
Method work
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function work(Monorepo $repo, InputInterface $input, SymfonyStyle $output): int
{
[$mainRepo, $branches] = [$repo->getRepository(), $input->getOption('branch')];
$currentBranch = $mainRepo->getBranch()->getName();
Function resolveRepository
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function resolveRepository(OutputInterface $output, callable $resolver, callable $checker = null): int
{
$result = 0;
foreach ($this->repositories as [$url, $remote, $path, $merge]) {
- 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 work
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function work(Monorepo $repo, InputInterface $input, SymfonyStyle $output): int
{
$mainRepo = $repo->getRepository();
$output->writeln('<info>Checking git filter-repo command existence...</info>');
Method __construct
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(string $rootPath, string $cachePath = null, bool $reclone)
{
if (!\file_exists($configFile = ($this->config['path'] = $rootPath).'/.monorepo')) {
throw new \RuntimeException(\sprintf('Config file "%s" does not exist.', $configFile));
}
Method resolveRepository
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function resolveRepository(OutputInterface $output, callable $resolver, callable $checker = null): int
{
$result = 0;
foreach ($this->repositories as [$url, $remote, $path, $merge]) {
Function initialize
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function initialize(InputInterface $input, OutputInterface $output): void
{
$repositories = [];
$this->output = new SymfonyStyle($input, $output);
$config = new Config(\rtrim($input->getOption('path') ?? $this->rootPath, '\/'), $input->getOption('cache'), $input->getOption('clean'));
- 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 initialize
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function initialize(InputInterface $input, OutputInterface $output): void
{
$repositories = [];
$this->output = new SymfonyStyle($input, $output);
$config = new Config(\rtrim($input->getOption('path') ?? $this->rootPath, '\/'), $input->getOption('cache'), $input->getOption('clean'));
Function execute
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function execute(InputInterface $input, OutputInterface $output): int
{
if (0 === $totalWorkerCount = \count($jobWorkers = $this->workers)) {
return self::FAILURE;
}
- 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 work
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function work(Monorepo $repo, InputInterface $input, SymfonyStyle $output): int
{
[$mainRepo, $branches] = [$repo->getRepository(), $input->getOption('branch')];
$currentBranch = $mainRepo->getBranch()->getName();
- 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 work
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function work(Monorepo $repo, InputInterface $input, SymfonyStyle $output): int
{
$mainRepo = $repo->getRepository();
$output->writeln('<info>Checking git filter-repo command existence...</info>');
- 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"