Skip to content

Fix static tests #111

Closed
Closed
@naydav

Description

@naydav

Now we have following failed static tests

1) Magento\Test\Php\LiveCodeTest::testCodeMess
PHP Code Mess has found error(s):
/home/travis/build/magento-engcom/msi/app/code/Magento/Inventory/Controller/Adminhtml/Stock/Save.php:24	The class Save has a coupling between objects value of 13. Consider to reduce the number of dependencies under 13.
/home/travis/build/magento-engcom/msi/app/code/Magento/Inventory/Controller/Adminhtml/Stock/Save.php:75	The method execute() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
/home/travis/build/magento-engcom/msi/app/code/Magento/InventoryApi/Test/Api/SourceRepository/ValidationTest.php:145	The method failedValidationDataProvider() has 140 lines of code. Current threshold is set to 100. Avoid really long methods.

Points of refactoring:

  1. Split Magento/Inventory/Controller/Adminhtml/Stock/Save.php class into several (move logic related to Stock creating in separate class)
  2. Add SuppressWarnings test and provide clear description about that (like we need to add SuppressWarnings due to a big size of data provider)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions