Between the “begin” and “end” steps, you need to build your project, execute tests and generate code coverage data. This part is specific to your needs and it is not detailed here.
As you see SonarC# plugin needs compiled code. My assumtpion is that this rule verifies binary code. Your example method executes the same operation many times and I’m sure that compiler optimizes it. Please try to add more logic which cannot be replaced with one instruction (in your case return 32;).
Looking at the scanner logs you should see something like Invalid rule parameter: maximum number of lines = 1. Must be at least 2. I cannot tell you why this limit was set but you have to give a value greater than or equals to 2.