We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Conditions | 1 |
| Paths | 1 |
| Total Lines | 87 |
| Code Lines | 82 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 81 |
| CRAP Score | 1 |
| Changes | 13 | ||
| Bugs | 0 | Features | 5 |
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 |
||
| 36 | 9 | public function getConfigTreeBuilder() |
|
| 37 | { |
||
| 38 | 9 | $treeBuilder = new TreeBuilder(); |
|
| 39 | 9 | $rootNode = $treeBuilder->root('overblog_graphql'); |
|
| 40 | |||
| 41 | $rootNode |
||
| 42 | 9 | ->children() |
|
| 43 | 9 | ->arrayNode('definitions') |
|
| 44 | 9 | ->addDefaultsIfNotSet() |
|
| 45 | 9 | ->children() |
|
| 46 | 9 | ->scalarNode('internal_error_message')->defaultNull()->end() |
|
| 47 | 9 | ->booleanNode('config_validation')->defaultValue($this->debug)->end() |
|
| 48 | 9 | ->arrayNode('schema') |
|
| 49 | 9 | ->addDefaultsIfNotSet() |
|
| 50 | 9 | ->children() |
|
| 51 | 9 | ->scalarNode('query')->defaultNull()->end() |
|
| 52 | 9 | ->scalarNode('mutation')->defaultNull()->end() |
|
| 53 | 9 | ->scalarNode('subscription')->defaultNull()->end() |
|
| 54 | 9 | ->end() |
|
| 55 | 9 | ->end() |
|
| 56 | 9 | ->arrayNode('mappings') |
|
| 57 | 9 | ->children() |
|
| 58 | 9 | ->arrayNode('types') |
|
| 59 | 9 | ->prototype('array') |
|
| 60 | 9 | ->addDefaultsIfNotSet() |
|
| 61 | 9 | ->children() |
|
| 62 | 9 | ->enumNode('type')->isRequired()->values(['yml', 'xml'])->end() |
|
| 63 | 9 | ->scalarNode('dir')->defaultNull()->end() |
|
| 64 | 9 | ->end() |
|
| 65 | 9 | ->end() |
|
| 66 | 9 | ->end() |
|
| 67 | 9 | ->end() |
|
| 68 | 9 | ->end() |
|
| 69 | 9 | ->arrayNode('builders') |
|
| 70 | 9 | ->children() |
|
| 71 | 9 | ->arrayNode('field') |
|
| 72 | 9 | ->prototype('array') |
|
| 73 | 9 | ->children() |
|
| 74 | 9 | ->scalarNode('alias')->isRequired()->end() |
|
| 75 | 9 | ->scalarNode('class')->isRequired()->end() |
|
| 76 | 9 | ->end() |
|
| 77 | 9 | ->end() |
|
| 78 | 9 | ->end() |
|
| 79 | 9 | ->arrayNode('args') |
|
| 80 | 9 | ->prototype('array') |
|
| 81 | 9 | ->children() |
|
| 82 | 9 | ->scalarNode('alias')->isRequired()->end() |
|
| 83 | 9 | ->scalarNode('class')->isRequired()->end() |
|
| 84 | 9 | ->end() |
|
| 85 | 9 | ->end() |
|
| 86 | 9 | ->end() |
|
| 87 | 9 | ->end() |
|
| 88 | 9 | ->end() |
|
| 89 | |||
| 90 | 9 | ->end() |
|
| 91 | 9 | ->end() |
|
| 92 | 9 | ->arrayNode('templates') |
|
| 93 | 9 | ->addDefaultsIfNotSet() |
|
| 94 | 9 | ->children() |
|
| 95 | 9 | ->scalarNode('graphiql') |
|
| 96 | 9 | ->defaultValue('OverblogGraphQLBundle:GraphiQL:index.html.twig') |
|
| 97 | 9 | ->end() |
|
| 98 | 9 | ->end() |
|
| 99 | 9 | ->end() |
|
| 100 | 9 | ->arrayNode('services') |
|
| 101 | 9 | ->addDefaultsIfNotSet() |
|
| 102 | 9 | ->children() |
|
| 103 | 9 | ->scalarNode('expression_language') |
|
| 104 | 9 | ->defaultValue('overblog_graphql.expression_language.default') |
|
| 105 | 9 | ->end() |
|
| 106 | 9 | ->scalarNode('cache_expression_language_parser') |
|
| 107 | 9 | ->defaultValue('overblog_graphql.cache_expression_language_parser.default') |
|
| 108 | 9 | ->end() |
|
| 109 | 9 | ->end() |
|
| 110 | 9 | ->end() |
|
| 111 | 9 | ->arrayNode('security') |
|
| 112 | 9 | ->addDefaultsIfNotSet() |
|
| 113 | 9 | ->children() |
|
| 114 | 9 | ->append($this->addSecurityQuerySection('query_max_depth', QueryDepth::DISABLED)) |
|
| 115 | 9 | ->append($this->addSecurityQuerySection('query_max_complexity', QueryComplexity::DISABLED)) |
|
| 116 | 9 | ->end() |
|
| 117 | 9 | ->end() |
|
| 118 | 9 | ->end() |
|
| 119 | 9 | ->end(); |
|
| 120 | |||
| 121 | 9 | return $treeBuilder; |
|
| 122 | } |
||
| 123 | |||
| 145 |