Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAROUANE MOULOUE - AHMED ED-DAHBY #12

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

marouanemouloue
Copy link

No description provided.

@marouanemouloue marouanemouloue changed the title Implementing 6 rules with tests MAROUANE MOULOUE Jan 13, 2023
@marouanemouloue marouanemouloue changed the title MAROUANE MOULOUE MAROUANE MOULOUE - AHMED ED-DAHBY Jan 14, 2023
violation.setLine(constant.getLineNum());
addViolation(violation);
}
if (!fieldName.contains("_")) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not necessary to have _ in a variable name


@Override
public boolean isActive() {
// TODO Auto-generated method stub
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

always remove irrelevant comments

for (FieldDeclaration field : attributWrapper.getFields()) {
//get the name of the first variable of the field and check if it starts with a lower case

String fieldName = field.getVariable(0).getNameAsString();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

field.getVariable(0) should be generated to all the variables, because some attributes may be declared as follow :

private String foo, bar, tgz;

final List<String> types = compilationUnit.getTypes();

for (String typeName : types) {
if (!Character.isUpperCase(typeName.charAt(0))) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!Character.isUpperCase ==> Character.isLowerCase

violation.setFileName(compilationUnit.getFileName());
addViolation(violation);
}
if(typeName.contains("_")) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not necessary that a variable contains _

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants