Ghimire
Ghimire

Reputation: 958

Code Analysis For Android using Checkstyle

I am checking my code using FindBugs, PMD and Checkstyle for improving the codebase and identify potential vulnerabilities along with design flaws. But i am facing trouble in finding out what exactly is the problem ? I have used Lambda expression in my Code.

Error Description

'member def modifier' have incorrect indentation level 8, expected level should be 4.   34
'member def modifier' have incorrect indentation level 8, expected level should be 4.   37
'member def modifier' have incorrect indentation level 8, expected level should be 4.   39
'method def modifier' have incorrect indentation level 8, expected level should be 4.   42
'method def' child have incorrect indentation level 16, expected level should be 8. 44
'method def' child have incorrect indentation level 16, expected level should be 8. 46
'method def' child have incorrect indentation level 16, expected level should be 8. 47
'method def' child have incorrect indentation level 16, expected level should be 8. 48
'method def' child have incorrect indentation level 16, expected level should be 8. 50
'method def' child have incorrect indentation level 16, expected level should be 8. 52

RegisterActivity

public class RegisterActivity extends DaggerAppCompatActivity implements LifecycleOwner {

        @Inject :**line number 34**
        public RegisterViewModel mRegisterViewModel;

        private ProgressDialog progressDialog; **line number 37**

        private ActivityRegisterBinding mBinding;

I have added my Activity which shows error at the certain line, but i am not able to find out what exactly is the problem in my Code.

Upvotes: 1

Views: 661

Answers (2)

Niroj Shr
Niroj Shr

Reputation: 157

Those are the java indentation violation, I dnt think that will make any impact in the project..
Solution referred by @themrhornet solution! should work since android IDE have their own rules

Open up preferences (cmd + , on the Mac, ctrl + alt + s on Windows), and go to Editor -> Code Style -> Java. On the tabs and indents spaces you can set the indents to 8.

Upvotes: 1

themrhornet
themrhornet

Reputation: 92

have you tried using indentation as specified in the error log?

Try this solution

[I meant to comment but due to lack of reputation I was denied that privilege.so, I had to post an answer]

Upvotes: 1

Related Questions