| Conditions | 1 | 
| Paths | 1 | 
| Total Lines | 57 | 
| Code Lines | 39 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 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  | 
            ||
| 33 | public function testBuildFilter()  | 
            ||
| 34 |     { | 
            ||
| 35 | $astSubtree = new ASTGroup(  | 
            ||
| 36 | 'T_LOGIC_AND',  | 
            ||
| 37 | [  | 
            ||
| 38 | new ASTGroup(  | 
            ||
| 39 | 'T_LOGIC_OR',  | 
            ||
| 40 | [  | 
            ||
| 41 | new ASTAssertion(  | 
            ||
| 42 | 'test_dse_1',  | 
            ||
| 43 | 'T_OP_EQ',  | 
            ||
| 44 | 'value1'  | 
            ||
| 45 | ),  | 
            ||
| 46 | new ASTAssertion(  | 
            ||
| 47 | 'test_dse_2',  | 
            ||
| 48 | 'T_OP_LT',  | 
            ||
| 49 | 'value2'  | 
            ||
| 50 | ),  | 
            ||
| 51 | ]  | 
            ||
| 52 | ),  | 
            ||
| 53 | new ASTAssertion(  | 
            ||
| 54 | 'test_dse_3',  | 
            ||
| 55 | 'T_OP_NEQ',  | 
            ||
| 56 | 'value3'  | 
            ||
| 57 | ),  | 
            ||
| 58 | ]  | 
            ||
| 59 | );  | 
            ||
| 60 | |||
| 61 | $filterDefinition1 = new Filter();  | 
            ||
| 62 |         $filterDefinition1->setConditionType('OR'); | 
            ||
| 63 |         $filter1 = new FilterCondition('test_dse_1', FilterCondition::METHOD_NUMERIC_EQ, 'value1', 'value1'); | 
            ||
| 64 |         $filter2 = new FilterCondition('test_dse_2', FilterCondition::METHOD_NUMERIC_LT, 'value2', 'value2'); | 
            ||
| 65 | $filterDefinition1[] = $filter1;  | 
            ||
| 66 | $filterDefinition1[] = $filter2;  | 
            ||
| 67 |         $filter3 = new FilterCondition('test_dse_3', FilterCondition::METHOD_NUMERIC_NEQ, 'value3', 'value3'); | 
            ||
| 68 | $filterDefinition2 = new Filter();  | 
            ||
| 69 |         $filterDefinition2->setConditionType('AND'); | 
            ||
| 70 | $filterDefinition2[] = $filterDefinition1;  | 
            ||
| 71 | $filterDefinition2[] = $filter3;  | 
            ||
| 72 | |||
| 73 | $expectedFilter = $filterDefinition2;  | 
            ||
| 74 | |||
| 75 | $dataSourceElements = [  | 
            ||
| 76 |             new Field('test_dse_1', '', '', new NumberDataType()), | 
            ||
| 77 |             new Field('test_dse_2', '', '', new NumberDataType()), | 
            ||
| 78 |             new Field('test_dse_3', '', '', new NumberDataType()), | 
            ||
| 79 | ];  | 
            ||
| 80 | |||
| 81 | $dataSourceProphecy = $this->prophesize(DataSourceInterface::class);  | 
            ||
| 82 | $dataSourceProphecy->getFields()->willReturn($dataSourceElements);  | 
            ||
| 83 | |||
| 84 | $interpreterFactory = new InterpreterFactory($this->extensionContainerProphecy->reveal(), new FilterConditionFactory(), $this->contextFactoryProphecy->reveal());  | 
            ||
| 85 | $interpreter = $interpreterFactory->create($dataSourceProphecy->reveal());  | 
            ||
| 86 | |||
| 87 | $actualFilter = $interpreter->buildFilter($astSubtree);  | 
            ||
| 88 | $this->assertEquals($expectedFilter, $actualFilter);  | 
            ||
| 89 | }  | 
            ||
| 90 | |||
| 152 | 
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.