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

Code Refactoring for more Type Safety #36

Closed
Weltraumschaf opened this issue Jul 2, 2023 · 3 comments
Closed

Code Refactoring for more Type Safety #36

Weltraumschaf opened this issue Jul 2, 2023 · 3 comments
Assignees

Comments

@Weltraumschaf
Copy link
Member

Class ImportScanService uses ...Map<String, Object> which is an unnecessary anti pattern in Java. We should use <String,String> Instead, since the underlying REST call only deals with string anyway.

@Weltraumschaf Weltraumschaf self-assigned this Jul 2, 2023
@Weltraumschaf Weltraumschaf moved this from Backlog to In Progress in secureCodeBox v4 Jul 2, 2023
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Jul 2, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Jul 2, 2023
In most languages it is a convention that getter/setter are side effect free
and do nothing more than get or set a value.

So I renamed this method to reflect that it is a factory method.

Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Jul 2, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Jul 2, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Jul 2, 2023
Use var and better names to unclutter the code.

Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Jul 2, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Jul 2, 2023
This is to avoid uninitialized state of parent properties, if some
type hierarchy is added afterwards.

Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Jul 2, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Jul 2, 2023
… not be changed accidentaly from outside

Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Jul 2, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Jul 2, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Jul 2, 2023
…vule w/o any computation

Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Jul 2, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Jul 2, 2023
…t errors

Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Jul 2, 2023
…t does not meet the requiremtns for method javadoc

Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Jul 2, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Jul 2, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Jul 2, 2023
…od signature

It should be avoided to use concrete implementations as types in an API,
if there is an interface because this gives the oportunity to switch
implementations at runtime w/o recompiling, whih is decoupling from
implementation details.

Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Jul 2, 2023
…er refactorings

Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Jul 2, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Jul 2, 2023
…<String,Object>

Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Jul 2, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Jul 2, 2023
In most languages it is a convention that getter/setter are side effect free
and do nothing more than get or set a value.

So I renamed this method to reflect that it is a factory method.

Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Jul 2, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Jul 2, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit that referenced this issue Sep 4, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit that referenced this issue Sep 4, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit that referenced this issue Sep 4, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit that referenced this issue Sep 4, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit that referenced this issue Sep 4, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Sep 4, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Sep 4, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Sep 4, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Sep 4, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Sep 4, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Sep 4, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Sep 4, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Sep 5, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Sep 5, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Sep 5, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit to Weltraumschaf/defectdojo-client-java that referenced this issue Sep 5, 2023
…rd are set

Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit that referenced this issue Sep 5, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit that referenced this issue Sep 5, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit that referenced this issue Sep 5, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit that referenced this issue Sep 5, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit that referenced this issue Sep 5, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit that referenced this issue Sep 5, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit that referenced this issue Sep 5, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit that referenced this issue Sep 5, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit that referenced this issue Sep 5, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Weltraumschaf added a commit that referenced this issue Sep 5, 2023
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
@Weltraumschaf Weltraumschaf moved this from In Progress to Todo in secureCodeBox v4 Dec 1, 2023
@Weltraumschaf
Copy link
Member Author

Type safty is improved, but not perfect. We want to remove Spring anyway, so closed.

@github-project-automation github-project-automation bot moved this from Todo to Done in secureCodeBox v4 Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants