Showing 35 of 47 total issues
Method parseItem
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function parseItem($localPack, GoogleDom $dom)
{
return [
'title' => function () use ($localPack, $dom) {
Method parseItem
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function parseItem($localPack, GoogleDom $dom)
{
return [
'title' => function () use ($localPack, $dom) {
Function parseGroups
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
protected function parseGroups(DomNodeList $elementGroups, IndexedResultSet $resultSet, $googleDom)
{
$rules = $this->getRules();
foreach ($elementGroups as $group) {
- 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 parseItem
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parseItem(GoogleDom $googleDOM, \DOMNode $node)
{
return new BaseResult(AdwordsResultType::SHOPPING_GROUP_PRODUCT, [
'title' => function () use ($googleDOM, $node) {
Function getRelatedSearches
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function getRelatedSearches()
{
$relatedSearches = [];
if ($this->isMobile()) {
$items = $this->cssQuery('#botstuff div:not(#bres) a.QsZ7bb');
- 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 parse
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parse(GoogleDom $googleDOM, \DomElement $node, IndexedResultSet $resultSet)
{
$item = [
'title' => function () use ($googleDOM, $node) {
$aTag = $googleDOM->getXpath()->query('descendant::h3/a[2]', $node)->item(0);
Function parseItem
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function parseItem($localPack, GoogleDom $dom)
{
return [
'title' => function () use ($localPack, $dom) {
- 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 parseItem
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function parseItem($localPack, GoogleDom $dom)
{
return [
'title' => function () use ($localPack, $dom) {
- 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 match
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function match(GoogleDom $dom, DomElement $node)
{
if ($node->childNodes->length == 1) {
$childNode = $node->getChildren()->getNodeAt(0);
- 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 parseItem
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function parseItem($localPack, GoogleDom $dom)
{
return [
'title' => function () use ($localPack, $dom) {
Method parseNode
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parseNode(GoogleDom $dom, \DOMElement $node)
{
return [
'title' => function () use ($dom, $node) {
$aTag = $dom->cssQuery('.rc .r a', $node)
Method query
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function query(GoogleUrlInterface $googleUrl, BrowserInterface $browser = null)
{
if ($googleUrl->getResultType() !== GoogleUrl::RESULT_TYPE_ALL) {
throw new Exception(
Function query
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function query(GoogleUrlInterface $googleUrl, BrowserInterface $browser = null)
{
if ($googleUrl->getResultType() !== GoogleUrl::RESULT_TYPE_ALL) {
throw new Exception(
- 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 parseNode
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parseNode(GoogleDom $dom, DomElement $node)
{
return [
'title' => function () use ($dom, $node) {
return $dom
Method parseNode
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parseNode(GoogleDom $dom, DomNodeInterface $node)
{
return [
'title' => function () use ($dom, $node) {
return $dom
Method parseNode
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parseNode(GoogleDom $dom, \DomElement $node)
{
// find the title/url
/* @var $aTag \DOMElement */
Method parseNode
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parseNode(GoogleDom $dom, DomNodeInterface $node)
{
return [
'title' => function () use ($dom, $node) {
return $dom
Method parse
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parse(GoogleDom $dom, \DomElement $node, IndexedResultSet $resultSet)
{
$item = new BaseResult(NaturalResultType::TWEETS_CAROUSEL, [
Method parse
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parse(GoogleDom $dom, \DomElement $node, IndexedResultSet $resultSet)
{
$xpath = $dom->getXpath();
$aTag = $xpath->query("descendant::h3[@class='r'][1]/a", $node)->item(0);
Method parse
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parse(GoogleDom $dom, \DomElement $node, IndexedResultSet $resultSet)
{
$data = $this->parseNode($dom, $node);
$resultTypes = [NaturalResultType::CLASSICAL];