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

SimpleModelService.getAllTemplate (sic) is a bit wut #20

Open
romdoq opened this issue Sep 25, 2018 · 0 comments
Open

SimpleModelService.getAllTemplate (sic) is a bit wut #20

romdoq opened this issue Sep 25, 2018 · 0 comments

Comments

@romdoq
Copy link
Contributor

romdoq commented Sep 25, 2018

Granted I'm no Java expert, but in addition to the method name not being plural, I think this function logic might need a second look:

public List<Model> getAllTemplate(boolean includeCommon) {
List<Model> allModels = modelService.getAllModelsIncludingCommonTemplate();
ArrayList<Model> templates = new ArrayList<Model>();
for (Model model : allModels) {
if (model.isTemplate()) {
if (!includeCommon && !model.isTemplate()) {
templates.add(model);
} else {
templates.add(model);
}
}
}
return templates;
}

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

No branches or pull requests

1 participant