EmicoEcommerce/Magento2TweakwiseExport

View on GitHub

Showing 83 of 111 total issues

Method setFromArray has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function setFromArray(array $data): void
    {
        foreach ($data as $key => $value) {
            switch ($key) {
                case 'entity_id':
Severity: Minor
Found in Model/Write/Products/ExportEntity.php - About 1 hr to fix

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

            Helper $helper,
            EavConfig $eavConfig,
            DbContext $dbContext,
            Manager $eventManager,
            ExportEntityFactory $entityFactory,
    Severity: Major
    Found in Model/Write/Products/Iterator.php - About 1 hr to fix

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

              Helper $helper,
              EavConfig $eavConfig,
              DbContext $dbContext,
              Manager $eventManager,
              ExportEntityFactory $entityFactory,
      Severity: Major
      Found in Model/Write/Price/Iterator.php - About 1 hr to fix

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

                Helper $helper,
                EavConfig $eavConfig,
                DbContext $dbContext,
                Manager $eventManager,
                ExportEntityFactory $entityFactory,
        Severity: Major
        Found in Model/Write/Stock/Iterator.php - About 1 hr to fix

          Method getIterator has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getIterator(): \Traversable
              {
                  while ($entityIds = $this->getEntityBatch()) {
                      try {
                          Profiler::start('eav-iterator::' . $this->entityCode);
          Severity: Minor
          Found in Model/Write/EavIterator.php - About 1 hr to fix

            Function scalarValue has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function scalarValue($value)
                {
                    if (is_array($value)) {
                        $data = [];
                        foreach ($value as $key => $childValue) {
            Severity: Minor
            Found in Model/Write/Products.php - About 1 hr 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 scalarValue has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function scalarValue($value)
                {
                    if (is_array($value)) {
                        $data = [];
                        foreach ($value as $key => $childValue) {
            Severity: Minor
            Found in Model/Write/Stock.php - About 1 hr 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 getIterator has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getIterator(): \Traversable
                {
                    $batch = $this->collectionFactory->create(['store' => $this->store]);
                    foreach (parent::getIterator() as $entityData) {
                        $entity = $this->entityFactory->create(
            Severity: Minor
            Found in Model/Write/Products/Iterator.php - About 1 hr 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 scalarValue has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function scalarValue($value)
                {
                    if (is_array($value)) {
                        $data = [];
                        foreach ($value as $key => $childValue) {
            Severity: Minor
            Found in Model/Write/Price.php - About 1 hr 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 getIterator has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getIterator(): \Traversable
                {
                    $batch = $this->collectionFactory->create(['store' => $this->store]);
                    foreach (parent::getIterator() as $entityData) {
                        $entity = $this->entityFactory->create(
            Severity: Minor
            Found in Model/Write/Stock/Iterator.php - About 1 hr 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 getIterator has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getIterator(): \Traversable
                {
                    $batch = $this->collectionFactory->create(['store' => $this->store]);
                    foreach (parent::getIterator() as $entityData) {
                        $entity = $this->entityFactory->create(
            Severity: Minor
            Found in Model/Write/Price/Iterator.php - About 1 hr 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

            Method getStockItem has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getStockItem(): ?StockItem
                {
                    if ($this->isStockCombined) {
                        return $this->stockItem;
                    }
            Severity: Minor
            Found in Traits/Stock/HasStockThroughChildren.php - About 1 hr to fix

              Method getAttributeSelectEnterprise has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function getAttributeSelectEnterprise(string $table, array $attributes): Select
                  {
                      $connection = $this->getConnection();
                      $select = $connection->select()
                          ->from(['attribute_table' => $table], [])
              Severity: Minor
              Found in Model/Write/EavIterator.php - About 1 hr to fix

                Method setFromArray has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function setFromArray(array $data): void
                    {
                        foreach ($data as $key => $value) {
                            switch ($key) {
                                case 'entity_id':
                Severity: Minor
                Found in Model/Write/Stock/ExportEntity.php - About 1 hr to fix

                  Method setFromArray has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function setFromArray(array $data): void
                      {
                          foreach ($data as $key => $value) {
                              switch ($key) {
                                  case 'entity_id':
                  Severity: Minor
                  Found in Model/Write/Price/ExportEntity.php - About 1 hr to fix

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

                            ProductType $productType,
                            EavIteratorFactory $eavIteratorFactory,
                            IteratorInitializer $iteratorInitializer,
                            ExportEntityFactory $entityChildFactory,
                            CollectionFactory $collectionFactory,
                    Severity: Major
                    Found in Model/Write/Products/CollectionDecorator/Children.php - About 1 hr to fix

                      Function setFromArray has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function setFromArray(array $data): void
                          {
                              foreach ($data as $key => $value) {
                                  switch ($key) {
                                      case 'entity_id':
                      Severity: Minor
                      Found in Model/Write/Products/ExportEntity.php - About 55 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 generateFeed has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function generateFeed($type = null): void
                          {
                              if ($this->config->isRealTime()) {
                                  $this->log->debug('Export set to real time, skipping cron export.');
                                  return;
                      Severity: Minor
                      Found in Cron/Export.php - About 55 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

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

                              EntityHydrator $hydrator,
                              WebsiteFactory $websiteFactory,
                              GroupFactory $groupFactory,
                              StoreFactory $storeFactory,
                              CategoryProvider $categoryProvider,
                      Severity: Major
                      Found in TestHelper/Data/StoreProvider.php - About 50 mins to fix

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

                                DbResourceHelper $dbResource,
                                StockSourceProviderFactory $stockSourceProviderFactory,
                                TweakwiseStockItemFactory $tweakwiseStockItemFactory,
                                StoreManagerInterface $storeManager,
                                StockResolverFactory $stockResolverFactory,
                          Severity
                          Category
                          Status
                          Source
                          Language