Showing 607 of 1,357 total issues
Function validateRow
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function validateRow(array $rowData, $rowNum): bool
{
$name = $rowData[ThesaurusInterface::NAME] ?? '';
$type = $rowData[ThesaurusInterface::TYPE] ?? '';
$terms = $rowData[self::COL_TERMS] ?? '';
- 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 getProductRewrite
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getProductRewrite($productRequestPath, $categoryRequestPath, $storeId = null): ?UrlRewrite
{
$productRewrite = null;
if (null === $storeId) {
$storeId = $this->storeManager->getStore()->getId();
- 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 getSearchQueriesByChildren
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getSearchQueriesByChildren(CategoryInterface $rootCategory): array
{
$queries = [];
$childrenIds = $rootCategory->getResource()->getChildren($rootCategory, false);
- 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 processTermsData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function processTermsData($data, $type): array
{
$termsRelations = [];
if ($type === ThesaurusInterface::TYPE_SYNONYM) {
foreach (array_filter(explode(';', $data)) as $termItem) {
- 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 execute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$progressIndicator = new ProgressIndicator($output, 'verbose', 100, ['⠏', '⠛', '⠹', '⢸', '⣰', '⣤', '⣆', '⡇']);
$progressIndicator->start('Processing...');
- 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 saveProductPositions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function saveProductPositions(CategoryInterface $category)
{
// Can be 0 if not on a store view.
$storeId = (int) $category->getStoreId();
- 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 getChildrenCategories
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function getChildrenCategories()
{
if ($this->childrenCategories === null) {
$currentCategory = $this->getDataProvider()->getCategory();
$this->childrenCategories = $currentCategory->getChildrenCategories();
- 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"