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 | 70 |
| Code Lines | 65 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 65 |
| CRAP Score | 1 |
| Changes | 11 | ||
| 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 |
||
| 35 | 45 | public function getConfigTreeBuilder() |
|
| 36 | { |
||
| 37 | 45 | $treeBuilder = new TreeBuilder(); |
|
| 38 | 45 | $rootNode = $treeBuilder->root('overblog_graphql'); |
|
| 39 | |||
| 40 | 1 | $rootNode |
|
| 41 | 45 | ->children() |
|
| 42 | 45 | ->arrayNode('definitions') |
|
| 43 | 45 | ->addDefaultsIfNotSet() |
|
| 44 | 45 | ->children() |
|
| 45 | 45 | ->scalarNode('internal_error_message')->defaultNull()->end() |
|
| 46 | 45 | ->booleanNode('config_validation')->defaultValue($this->debug)->end() |
|
| 47 | 45 | ->arrayNode('schema') |
|
| 48 | 45 | ->addDefaultsIfNotSet() |
|
| 49 | 45 | ->children() |
|
| 50 | 45 | ->scalarNode('query')->defaultNull()->end() |
|
| 51 | 45 | ->scalarNode('mutation')->defaultNull()->end() |
|
| 52 | 45 | ->scalarNode('subscription')->defaultNull()->end() |
|
| 53 | 45 | ->end() |
|
| 54 | 45 | ->end() |
|
| 55 | 45 | ->arrayNode('mappings') |
|
| 56 | 45 | ->children() |
|
| 57 | 45 | ->arrayNode('types') |
|
| 58 | 45 | ->prototype('array') |
|
| 59 | 45 | ->addDefaultsIfNotSet() |
|
| 60 | 45 | ->children() |
|
| 61 | 45 | ->enumNode('type')->isRequired()->values(['yml', 'xml'])->end() |
|
| 62 | 45 | ->scalarNode('dir')->defaultNull()->end() |
|
| 63 | 45 | ->end() |
|
| 64 | 45 | ->end() |
|
| 65 | 45 | ->end() |
|
| 66 | 45 | ->end() |
|
| 67 | 45 | ->end() |
|
| 68 | // TODO remove when types mapping 100% functional |
||
| 69 | 45 | ->variableNode('types') |
|
| 70 | 45 | ->info('Defining types using semantic config is deprecated and will be soon removed.') |
|
| 71 | 45 | ->end() |
|
| 72 | 45 | ->end() |
|
| 73 | 45 | ->end() |
|
| 74 | 45 | ->arrayNode('templates') |
|
| 75 | 45 | ->addDefaultsIfNotSet() |
|
| 76 | 45 | ->children() |
|
| 77 | 45 | ->scalarNode('graphiql') |
|
| 78 | 45 | ->defaultValue('OverblogGraphQLBundle:GraphiQL:index.html.twig') |
|
| 79 | 45 | ->end() |
|
| 80 | 45 | ->end() |
|
| 81 | 45 | ->end() |
|
| 82 | 45 | ->arrayNode('services') |
|
| 83 | 45 | ->addDefaultsIfNotSet() |
|
| 84 | 45 | ->children() |
|
| 85 | 45 | ->scalarNode('expression_language') |
|
| 86 | 45 | ->defaultValue('overblog_graphql.expression_language.default') |
|
| 87 | 45 | ->end() |
|
| 88 | 45 | ->scalarNode('cache_expression_language_parser') |
|
| 89 | 45 | ->defaultValue('overblog_graphql.cache_expression_language_parser.default') |
|
| 90 | 45 | ->end() |
|
| 91 | 45 | ->end() |
|
| 92 | 45 | ->end() |
|
| 93 | 45 | ->arrayNode('security') |
|
| 94 | 45 | ->addDefaultsIfNotSet() |
|
| 95 | 45 | ->children() |
|
| 96 | 45 | ->append($this->addSecurityQuerySection('query_max_depth', QueryDepth::DISABLED)) |
|
| 97 | 45 | ->append($this->addSecurityQuerySection('query_max_complexity', QueryDepth::DISABLED)) |
|
| 98 | 45 | ->end() |
|
| 99 | 45 | ->end() |
|
| 100 | 45 | ->end() |
|
| 101 | 45 | ->end(); |
|
| 102 | |||
| 103 | 45 | return $treeBuilder; |
|
| 104 | } |
||
| 105 | |||
| 127 |