Netbeans: warning message

4

I have a warning message that tells me that the method is 23 lines and in parentheses says (20 allowed) I do not understand why this message, / p>

What does this mean? How do I disable this warning?

    
asked by anonymous 04.09.2015 / 15:51

3 answers

7

It's a hint that your method could be better, perhaps splitting it into sub-methods. But that does not have to be followed strictly and does not always mean that your code can be improved.

You can disable or configure these tips in:

  • Tools - > Options - > Editor - > Tips (EN - Tools-> Options-> Editor-> Hints)
  • Choose the language, in your case PHP
  • Look for the 'Many Lines' option and set or uncheck the option to disable.

    
04.09.2015 / 15:58
2

It seems that netbeans has some tool that checks the code, in this case it suggests that the method has 20 lines at maximum, other options can be checkspelling, minimum size in variable names etc.

    
04.09.2015 / 15:59
2

Nothing much to worry about. Only a message that the IDE generates from a configuration that can parameterize in number of lines.

The idea for this type of control has to do with some good development practice rules that IDE implements or can help with. One of them is that the smaller the number of lines in a function the more effective this can be and the better readability your code has.

To modify this behavior you can: Tools-> Options-> Editor , in the Hints tab select the option "Too Many Lines" > "Function (Method) Declaration. The default is 20.

    
04.09.2015 / 16:01