line limit for function??

  • as i am currently walking thru the millions of warnings i get, what shall i think of such a warning?

    The function GetDDescription has 803 lines, this exceeds the limit of 500 lines.

    edit: this now appears for a bunch of functions i use in the plugin. does it mean the compiler isn't checking the rest of the lines? isn't it set a bit to low?

  • Hi ello,

    no, you don't need to worry, the compiler won't check the remaining lines. It is a warning, we use internally to make people write better code. Usually smaller functions are easier to maintain and thinking about how to properly split and slice your code leads to better better results. By the way, compilers nowadays do quite a good job on inlining functions, so one does not need to be afraid of performance issues. But in the end this is probably also a matter of personal taste and so you can configure this in your projectdefinition.txt. See the Stylecheck options in our Project Tool documentation, there you have the option to set the maximum line count for functions (stylecheck.max-linecount=number).

    Please consider the use of tags and of our Q&A system.