| Conditions | 16 |
| Paths | 16384 |
| Total Lines | 113 |
| Code Lines | 83 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 73 | public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context) |
||
| 74 | { |
||
| 75 | $setup->startSetup(); |
||
| 76 | if (!$setup->getConnection()->tableColumnExists($setup->getTable('sales_order'), 'payone_clearing_reference')) { |
||
| 77 | $salesInstaller = $this->salesSetupFactory->create(['resourceName' => 'sales_setup', 'setup' => $setup]); |
||
| 78 | $salesInstaller->addAttribute( |
||
| 79 | 'order', |
||
| 80 | 'payone_clearing_reference', |
||
| 81 | ['type' => 'varchar', 'length' => 64, 'default' => ''] |
||
| 82 | ); |
||
| 83 | } |
||
| 84 | if (!$setup->getConnection()->tableColumnExists($setup->getTable('sales_order'), 'payone_workorder_id')) { |
||
| 85 | $salesInstaller = $this->salesSetupFactory->create(['resourceName' => 'sales_setup', 'setup' => $setup]); |
||
| 86 | $salesInstaller->addAttribute( |
||
| 87 | 'order', |
||
| 88 | 'payone_workorder_id', |
||
| 89 | ['type' => 'varchar', 'length' => 64, 'default' => ''] |
||
| 90 | ); |
||
| 91 | } |
||
| 92 | if (!$setup->getConnection()->tableColumnExists($setup->getTable('sales_order'), 'payone_installment_duration')) { |
||
| 93 | $salesInstaller = $this->salesSetupFactory->create(['resourceName' => 'sales_setup', 'setup' => $setup]); |
||
| 94 | $salesInstaller->addAttribute( |
||
| 95 | 'order', |
||
| 96 | 'payone_installment_duration', |
||
| 97 | ['type' => 'integer', 'length' => null] |
||
| 98 | ); |
||
| 99 | } |
||
| 100 | if (!$setup->getConnection()->tableColumnExists($setup->getTable('sales_order'), 'payone_clearing_bankaccountholder')) { |
||
| 101 | $salesInstaller = $this->salesSetupFactory->create(['resourceName' => 'sales_setup', 'setup' => $setup]); |
||
| 102 | $salesInstaller->addAttribute( |
||
| 103 | 'order', |
||
| 104 | 'payone_clearing_bankaccountholder', |
||
| 105 | ['type' => 'varchar', 'length' => 64, 'default' => ''] |
||
| 106 | ); |
||
| 107 | } |
||
| 108 | if (!$setup->getConnection()->tableColumnExists($setup->getTable('sales_order'), 'payone_clearing_bankcountry')) { |
||
| 109 | $salesInstaller = $this->salesSetupFactory->create(['resourceName' => 'sales_setup', 'setup' => $setup]); |
||
| 110 | $salesInstaller->addAttribute( |
||
| 111 | 'order', |
||
| 112 | 'payone_clearing_bankcountry', |
||
| 113 | ['type' => 'varchar', 'length' => 2, 'default' => ''] |
||
| 114 | ); |
||
| 115 | } |
||
| 116 | if (!$setup->getConnection()->tableColumnExists($setup->getTable('sales_order'), 'payone_clearing_bankaccount')) { |
||
| 117 | $salesInstaller = $this->salesSetupFactory->create(['resourceName' => 'sales_setup', 'setup' => $setup]); |
||
| 118 | $salesInstaller->addAttribute( |
||
| 119 | 'order', |
||
| 120 | 'payone_clearing_bankaccount', |
||
| 121 | ['type' => 'varchar', 'length' => 32, 'default' => ''] |
||
| 122 | ); |
||
| 123 | } |
||
| 124 | if (!$setup->getConnection()->tableColumnExists($setup->getTable('sales_order'), 'payone_clearing_bankcode')) { |
||
| 125 | $salesInstaller = $this->salesSetupFactory->create(['resourceName' => 'sales_setup', 'setup' => $setup]); |
||
| 126 | $salesInstaller->addAttribute( |
||
| 127 | 'order', |
||
| 128 | 'payone_clearing_bankcode', |
||
| 129 | ['type' => 'varchar', 'length' => 32, 'default' => ''] |
||
| 130 | ); |
||
| 131 | } |
||
| 132 | if (!$setup->getConnection()->tableColumnExists($setup->getTable('sales_order'), 'payone_clearing_bankiban')) { |
||
| 133 | $salesInstaller = $this->salesSetupFactory->create(['resourceName' => 'sales_setup', 'setup' => $setup]); |
||
| 134 | $salesInstaller->addAttribute( |
||
| 135 | 'order', |
||
| 136 | 'payone_clearing_bankiban', |
||
| 137 | ['type' => 'varchar', 'length' => 64, 'default' => ''] |
||
| 138 | ); |
||
| 139 | } |
||
| 140 | if (!$setup->getConnection()->tableColumnExists($setup->getTable('sales_order'), 'payone_clearing_bankbic')) { |
||
| 141 | $salesInstaller = $this->salesSetupFactory->create(['resourceName' => 'sales_setup', 'setup' => $setup]); |
||
| 142 | $salesInstaller->addAttribute( |
||
| 143 | 'order', |
||
| 144 | 'payone_clearing_bankbic', |
||
| 145 | ['type' => 'varchar', 'length' => 32, 'default' => ''] |
||
| 146 | ); |
||
| 147 | } |
||
| 148 | if (!$setup->getConnection()->tableColumnExists($setup->getTable('sales_order'), 'payone_clearing_bankcity')) { |
||
| 149 | $salesInstaller = $this->salesSetupFactory->create(['resourceName' => 'sales_setup', 'setup' => $setup]); |
||
| 150 | $salesInstaller->addAttribute( |
||
| 151 | 'order', |
||
| 152 | 'payone_clearing_bankcity', |
||
| 153 | ['type' => 'varchar', 'length' => 64, 'default' => ''] |
||
| 154 | ); |
||
| 155 | } |
||
| 156 | if (!$setup->getConnection()->tableColumnExists($setup->getTable('sales_order'), 'payone_clearing_bankname')) { |
||
| 157 | $salesInstaller = $this->salesSetupFactory->create(['resourceName' => 'sales_setup', 'setup' => $setup]); |
||
| 158 | $salesInstaller->addAttribute( |
||
| 159 | 'order', |
||
| 160 | 'payone_clearing_bankname', |
||
| 161 | ['type' => 'varchar', 'length' => 64, 'default' => ''] |
||
| 162 | ); |
||
| 163 | } |
||
| 164 | if (!$setup->getConnection()->tableColumnExists($setup->getTable('sales_order'), 'payone_refund_iban')) { |
||
| 165 | $salesInstaller = $this->salesSetupFactory->create(['resourceName' => 'sales_setup', 'setup' => $setup]); |
||
| 166 | $salesInstaller->addAttribute( |
||
| 167 | 'order', |
||
| 168 | 'payone_refund_iban', |
||
| 169 | ['type' => 'varchar', 'length' => 64, 'default' => ''] |
||
| 170 | ); |
||
| 171 | } |
||
| 172 | if (!$setup->getConnection()->tableColumnExists($setup->getTable('sales_order'), 'payone_refund_bic')) { |
||
| 173 | $salesInstaller = $this->salesSetupFactory->create(['resourceName' => 'sales_setup', 'setup' => $setup]); |
||
| 174 | $salesInstaller->addAttribute( |
||
| 175 | 'order', |
||
| 176 | 'payone_refund_bic', |
||
| 177 | ['type' => 'varchar', 'length' => 64, 'default' => ''] |
||
| 178 | ); |
||
| 179 | } |
||
| 180 | |||
| 181 | $serializedRows = $this->getSerializedConfigRows($setup); |
||
| 182 | if (!empty($serializedRows) && version_compare($this->shopHelper->getMagentoVersion(), '2.2.0', '>=')) { |
||
| 183 | $this->convertSerializedDataToJson($setup, $serializedRows); |
||
| 184 | } |
||
| 185 | $setup->endSetup(); |
||
| 186 | } |
||
| 224 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths