Showing 19 of 47 total issues
Function _generateWpdbExpressionHashMap
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function _generateWpdbExpressionHashMap(&$map, ExpressionInterface $condition, array $ignore)
{
foreach ($condition->getTerms() as $_idx => $_term) {
if ($_term instanceof ExpressionInterface) {
$this->_generateWpdbExpressionHashMap($map, $_term, $ignore);
- 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 _extractRecordData
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function _extractRecordData($record, array &$hashMap = [])
{
// Initialize variable, in case it was declared implicitly during the method call
if ($hashMap === null) {
$hashMap = [];
- 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 _update
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _update($changeSet, LogicalExpressionInterface $condition = null)
{
if ($condition === null) {
throw $this->_createInvalidArgumentException(
$this->__('Null conditions are not supported for WordPress post updates'),
Method _normalizeWpPostDataValue
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _normalizeWpPostDataValue($value)
{
if ($value instanceof TermInterface && !($value instanceof LiteralTermInterface)) {
throw $this->_createInvalidArgumentException(
$this->__('Only literal terms are supported for native WP operations'),
Method _buildSelectSql
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
$columns,
$tables,
$joins = [],
LogicalExpressionInterface $where = null,
$ordering = null,
Method _extractPostIdsFromInExpression
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _extractPostIdsFromInExpression(LogicalExpressionInterface $expression)
{
$postIds = [];
$isPostIdField = false;
$pEntity = $this->_getPostEntityName();
Method _extractPostIdsFromBetweenExpression
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _extractPostIdsFromBetweenExpression(LogicalExpressionInterface $expression)
{
$isPostIdField = false;
$pEntity = $this->_getPostEntityName();
$pIdField = $this->_getPostIdFieldName();
Function _normalizeWpPostDataArray
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function _normalizeWpPostDataArray($postData)
{
// If an array or traversable, then meta data can be extracted. Forward to the other method
if (is_array($postData) || $postData instanceof Traversable) {
return $this->_normalizeWpPostDataAndMeta($postData);
- 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 _extractPostIdsFromBetweenExpression
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function _extractPostIdsFromBetweenExpression(LogicalExpressionInterface $expression)
{
$isPostIdField = false;
$pEntity = $this->_getPostEntityName();
$pIdField = $this->_getPostIdFieldName();
- 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 _extractPostIdsFromInExpression
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function _extractPostIdsFromInExpression(LogicalExpressionInterface $expression)
{
$postIds = [];
$isPostIdField = false;
$pEntity = $this->_getPostEntityName();
- 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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
wpdb $wpdb,
TemplateInterface $expressionTemplate,
MapFactoryInterface $factory,
$tables,
$fieldColumnMap,
Function _normalizeWpPostDataValue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function _normalizeWpPostDataValue($value)
{
if ($value instanceof TermInterface && !($value instanceof LiteralTermInterface)) {
throw $this->_createInvalidArgumentException(
$this->__('Only literal terms are supported for native WP operations'),
- 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 _extractPostIdsFromEqualsExpression
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function _extractPostIdsFromEqualsExpression(LogicalExpressionInterface $expression = null)
{
$postIds = [];
$isPostIdField = false;
$pEntity = $this->_getPostEntityName();
- 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 _init
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
wpdb $wpdb,
TemplateInterface $expressionTemplate,
MapFactoryInterface $factory,
$tables,
$fieldColumnMap,
Method _buildDeleteSql
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$table,
LogicalExpressionInterface $condition = null,
$ordering = null,
$limit = null,
$offset = null,
Method _buildUpdateSql
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$table,
$changeSet,
LogicalExpressionInterface $condition = null,
$ordering = null,
$limit = null,
Function _preProcessChangeSet
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function _preProcessChangeSet($changeSet, &$hashMap = [])
{
if ($hashMap === null) {
$hashMap = [];
}
- 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 _mapIterable
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$iterable,
$callback,
$start = null,
$count = null,
array &$results = null
Method _mapIterable
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$iterable,
$callback,
$start = null,
$count = null,
array &$results = null