Showing 15 of 112 total issues
Function setParametersOnInstance
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
private function setParametersOnInstance(ConfigurationInterface $instance)
{
$classReflection = new \ReflectionObject($instance);
foreach ($this->instanceParameters as $paramName => $paramValue) {
- 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 parseFeedXml
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function parseFeedXml($feed)
{
$feed = simplexml_load_string($feed);
if ($feed === false) {
$this->logger->error('RSS XML parsing failed in ' . $this->getName(), libxml_get_errors());
- 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 runMainLoop
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
private function runMainLoop()
{
$except = null;
while (true) {
- 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 parseFeedXml
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parseFeedXml($feed)
{
$feed = simplexml_load_string($feed);
if ($feed === false) {
$this->logger->error('RSS XML parsing failed in ' . $this->getName(), libxml_get_errors());
Function matchDownloadLinks
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function matchDownloadLinks($sourceName, array $links)
{
$this->logger->debug("Matching links from source $sourceName against all rules");
$linksToDownload = [];
- 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 setParametersOnInstance
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function setParametersOnInstance(ConfigurationInterface $instance)
{
$classReflection = new \ReflectionObject($instance);
foreach ($this->instanceParameters as $paramName => $paramValue) {
Method runMainLoop
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function runMainLoop()
{
$except = null;
while (true) {
Method prepareCUrl
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function prepareCUrl()
{
$this->cUrl = curl_init((string)$this->fetchRequest->getUri());
if ($this->cUrl === false) {
throw new \RuntimeException('Failed to initialize cURL - internal error');
Function downloadLinks
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function downloadLinks(array $links)
{
$this->logger->info('Begin downloading ' . count($links) . ' files...');
foreach ($links as $name => $link) {
- 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 matchDownloadLinks
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function matchDownloadLinks($sourceName, array $links)
{
$this->logger->debug("Matching links from source $sourceName against all rules");
$linksToDownload = [];
Method extractLink
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function extractLink($string)
{
$matchResult = @preg_match($this->configuration->getLinkExtractPattern(), $string, $matches);
if ($matchResult === false) {
throw new RegexException(
Method downloadLinks
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function downloadLinks(array $links)
{
$this->logger->info('Begin downloading ' . count($links) . ' files...');
foreach ($links as $name => $link) {
Function buildStreamsArrays
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function buildStreamsArrays(&$read, &$write)
{
$currentTime = time();
foreach ($this->sources as $sourceName => $sourceObj) {
- 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 extractLink
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function extractLink($string)
{
$matchResult = @preg_match($this->configuration->getLinkExtractPattern(), $string, $matches);
if ($matchResult === false) {
throw new RegexException(
- 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 applyBlacklist
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function applyBlacklist(array &$entriesToFilter)
{
foreach ($this->blacklist as $key => $value) {
if (isset($entriesToFilter[$key]) && $entriesToFilter[$key] === $value) {
$this->logger->debug(
- 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"