resources/ffigen/LibrdkafkaHeaderFiles.php
Method prepareFileContent
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function prepareFileContent(string $file, string $content, string $version): string
{
if (strpos($file, 'rdkafka.h') !== false) {
// prefilter header file content - not supported by cparser
$content = preg_replace_callback(
Method loadSupportedVersions
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function loadSupportedVersions(): array
{
echo 'Load librdkafka releases ...';
$content = file_get_contents(
Function prepareVersion
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
public function prepareVersion(string $version): void
{
if (array_key_exists($version, $this->supportedVersions) === false) {
throw new \InvalidArgumentException(sprintf('Version %s not supported', $version));
}
- 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 loadSupportedVersions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
private function loadSupportedVersions(): array
{
echo 'Load librdkafka releases ...';
$content = file_get_contents(
- 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
Avoid too many return
statements within this method. Open
Open
return $content;
Avoid too many return
statements within this method. Open
Open
return '';
Avoid too many return
statements within this method. Open
Open
return '//' . $matches[1];