| Conditions | 2 |
| Paths | 2 |
| Total Lines | 97 |
| Code Lines | 90 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 1 | Features | 1 |
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 |
||
| 15 | public function getConfigTreeBuilder() |
||
| 16 | { |
||
| 17 | $treeBuilder = new TreeBuilder('dtc_grid'); |
||
| 18 | |||
| 19 | if (method_exists($treeBuilder, 'getRootNode')) { |
||
| 20 | $rootNode = $treeBuilder->getRootNode(); |
||
| 21 | } else { |
||
| 22 | // BC layer for symfony/config 4.1 and older |
||
| 23 | $rootNode = $treeBuilder->root('dtc_grid'); |
||
| 24 | } |
||
| 25 | |||
| 26 | $rootNode |
||
| 27 | ->children() |
||
| 28 | ->arrayNode('reflection') |
||
| 29 | ->addDefaultsIfNotSet() |
||
| 30 | ->children() |
||
| 31 | ->variableNode('allowed_entities')->defaultNull()->end() |
||
| 32 | ->end() |
||
| 33 | ->end() |
||
| 34 | ->arrayNode('jq_grid') |
||
| 35 | ->children() |
||
| 36 | ->variableNode('css')->end() |
||
| 37 | ->variableNode('js')->end() |
||
| 38 | ->variableNode('options')->end() |
||
| 39 | ->arrayNode('local') |
||
| 40 | ->children() |
||
| 41 | ->arrayNode('css') |
||
| 42 | ->prototype('scalar')->end() |
||
| 43 | ->end() |
||
| 44 | ->arrayNode('js') |
||
| 45 | ->prototype('scalar')->end() |
||
| 46 | ->end() |
||
| 47 | ->end() |
||
| 48 | ->end() |
||
| 49 | ->end() |
||
| 50 | ->end() |
||
| 51 | ->scalarNode('purl') |
||
| 52 | ->defaultValue('//cdnjs.cloudflare.com/ajax/libs/purl/2.3.1/purl.min.js') |
||
| 53 | ->end() |
||
| 54 | ->arrayNode('jquery') |
||
| 55 | ->addDefaultsIfNotSet() |
||
| 56 | ->children() |
||
| 57 | ->scalarNode('url') |
||
| 58 | ->defaultValue('//code.jquery.com/jquery-3.4.1.min.js') |
||
| 59 | ->end() |
||
| 60 | ->scalarNode('integrity') |
||
| 61 | ->defaultValue('sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=') |
||
| 62 | ->end() |
||
| 63 | ->scalarNode('crossorigin') |
||
| 64 | ->defaultValue('anonymous') |
||
| 65 | ->end() |
||
| 66 | ->end() |
||
| 67 | ->end() |
||
| 68 | ->arrayNode('datatables') |
||
| 69 | ->addDefaultsIfNotSet() |
||
| 70 | ->children() |
||
| 71 | ->scalarNode('class')->defaultNull()->end() |
||
| 72 | ->variableNode('css') |
||
| 73 | ->defaultValue(['//cdn.datatables.net/1.10.20/css/jquery.dataTables.min.css']) |
||
| 74 | ->end() |
||
| 75 | ->variableNode('js') |
||
| 76 | ->defaultValue(['//cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js', |
||
| 77 | '//cdn.datatables.net/1.10.20/js/dataTables.bootstrap.min.js', ]) |
||
| 78 | ->end() |
||
| 79 | ->arrayNode('local') |
||
| 80 | ->children() |
||
| 81 | ->arrayNode('css') |
||
| 82 | ->prototype('scalar')->end() |
||
| 83 | ->end() |
||
| 84 | ->arrayNode('js') |
||
| 85 | ->prototype('scalar')->end() |
||
| 86 | ->end() |
||
| 87 | ->end() |
||
| 88 | ->end() |
||
| 89 | ->variableNode('options')->end() |
||
| 90 | ->end() |
||
| 91 | ->end() |
||
| 92 | ->arrayNode('table') |
||
| 93 | ->children() |
||
| 94 | ->variableNode('options')->end() |
||
| 95 | ->end() |
||
| 96 | ->end() |
||
| 97 | ->arrayNode('theme') |
||
| 98 | ->addDefaultsIfNotSet() |
||
| 99 | ->children() |
||
| 100 | ->variableNode('css') |
||
| 101 | ->defaultValue(['https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css', 'https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css']) |
||
| 102 | ->end() |
||
| 103 | ->variableNode('js') |
||
| 104 | ->defaultValue(['https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js']) |
||
| 105 | ->end() |
||
| 106 | ->end() |
||
| 107 | ->end() |
||
| 108 | ->scalarNode('page_div_style')->defaultValue('margin: 10px')->end() |
||
| 109 | ->end(); |
||
| 110 | |||
| 111 | return $treeBuilder; |
||
| 112 | } |
||
| 114 |
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