Smile-SA/magento2-module-product-label

View on GitHub

Showing 29 of 29 total issues

Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

        ContextInterface $context,
        UiComponentFactory $uiComponentFactory,
        UrlInterface $urlBuilder,
        Escaper $escaper,
        array $components = [],
Severity: Minor
Found in Ui/Component/Listing/Column/AttributeActions.php - About 45 mins to fix

    Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            CollectionProcessor $collectionProcessor,
            $objectFactory,
            AbstractResourceModel $objectResource,
            $objectCollectionFactory,
            $objectSearchResultsFactory,
    Severity: Minor
    Found in Model/Repository/Manager.php - About 45 mins to fix

      Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              Context $context,
              Registry $coreRegistry,
              ProductLabelFactory $modelFactory,
              ProductLabelRepository $modelRepository,
              Filter $filter,
      Severity: Minor
      Found in Controller/Adminhtml/ProductLabel/AbstractAction.php - About 45 mins to fix

        Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                RepositoryManagerFactory $repositoryManagerFactory,
                ProductLabelInterfaceFactory $objectFactory,
                ProductLabelResourceModel $objectResource,
                ProductLabelCollectionFactory $objectCollectionFactory,
                ProductLabelSearchResultsInterfaceFactory $objectSearchResultsFactory
        Severity: Minor
        Found in Model/Repository/ProductLabel.php - About 35 mins to fix

          Method aroundSetupAttributeMeta has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  Eav $subject,
                  callable $proceed,
                  ProductAttributeInterface $attribute,
                  string $groupCode,
                  int $sortOrder
          Severity: Minor
          Found in Plugin/Catalog/Ui/DataProvider/Product/Form/Modifier/EavPlugin.php - About 35 mins to fix

            Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    ObjectManagerInterface $objectManager,
                    ConfigInterface $presentationConfig,
                    AssetImageFactory $viewAssetImageFactory,
                    PlaceholderFactory $viewAssetPlaceholderFactory,
                    ParamsBuilder $imageParamsBuilder
            Severity: Minor
            Found in Block/Product/ImageFactory.php - About 35 mins to fix

              Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      Context $context,
                      ProductLabelRepositoryInterface $productLabelRepository,
                      FilterBuilder $filterBuilder,
                      SortOrderBuilder $sortOrderBuilder,
                      SearchCriteriaBuilder $searchCriteriaBuilder
              Severity: Minor
              Found in Helper/Data.php - About 35 mins to fix

                Function prepareDataSource has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function prepareDataSource(array $dataSource): array
                    {
                        if (isset($dataSource['data']['items'])) {
                            foreach ($dataSource['data']['items'] as & $item) {
                                if (isset($item['product_label_id'])) {
                Severity: Minor
                Found in Ui/Component/Listing/Column/AttributeActions.php - About 25 mins to fix

                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

                    public function execute()
                    {
                        /** @var ResultRedirect $resultRedirect */
                        $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
                        $resultRedirect->setPath('*/*/');
                Severity: Minor
                Found in Controller/Adminhtml/ProductLabel/Save.php - About 25 mins to fix

                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

                Severity
                Category
                Status
                Source
                Language