Netbeans IDE: Warning Message

Asked

Viewed 767 times

4

I have a warning message that tells me method is 23 lines and between parentheses says (20 allowed) I do not understand why this message, follows below:

inserir a descrição da imagem aqui

What does that mean? has how to disable this warning?

3 answers

7


It is a hint that your method could be better, perhaps by dividing it into sub-methods. But this does not need to be followed to the letter 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 PHP case
  • Look for the 'Many lines' option (EN: "Too Many Lines") and set or uncheck the option to disable.

inserir a descrição da imagem aqui

  • 1

    EN: Tools->Options->Editor in the Hints tab select PHP and look for "Too Many Lines"

  • 2

    @Jorgeb. Good, I added in the reply, ;)

2

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

2

Nothing to really worry about. Only a message the IDE generates from a setting that can parameterize into number of rows.

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

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.