github-code-scanning[bot] commented on code in PR #468:
URL: https://github.com/apache/syncope/pull/468#discussion_r1221413614


##########
client/idm/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder.java:
##########
@@ -185,16 +140,63 @@
     }
 
     /**
-     * Construct.
-     *
-     * @param resourceTO external resource to be updated.
-     * @param adminRealm admin realm
-     * @param pageRef Caller page reference.
+     * The object type specification step.
      */
-    public ProvisionWizardBuilder(final ResourceTO resourceTO, final String 
adminRealm, final PageReference pageRef) {
+    protected final class ObjectType extends WizardStep {

Review Comment:
   ## Inner class could be static
   
   ObjectType could be made static, since the enclosing instance is used only 
in its constructor.
   
   [Show more 
details](https://github.com/apache/syncope/security/code-scanning/1311)



##########
client/idrepo/console/src/main/java/org/apache/syncope/client/console/rest/BaseRestClient.java:
##########
@@ -74,7 +58,23 @@
         return builder.build();
     }
 
-    protected static <E extends JAXRSService, T> T getObject(
+    public SyncopeService getSyncopeService() {
+        return getService(SyncopeService.class);
+    }
+
+    protected <T> T getService(final Class<T> serviceClass) {
+        return SyncopeConsoleSession.get().getService(serviceClass);
+    }
+
+    protected <T> T getService(final String etag, final Class<T> serviceClass) 
{
+        return SyncopeConsoleSession.get().getService(etag, serviceClass);
+    }
+
+    protected <T> void resetClient(final Class<T> serviceClass) {
+        SyncopeConsoleSession.get().resetClient(serviceClass);
+    }
+
+    protected <E extends JAXRSService, T> T getObject(

Review Comment:
   ## Constant interface anti-pattern
   
   Type E implements constant interface [JAXRSService](1).
   
   [Show more 
details](https://github.com/apache/syncope/security/code-scanning/1315)



##########
client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/role/RoleWizardBuilder.java:
##########
@@ -195,29 +209,29 @@
         }
     }
 
-    protected static class DynRealms extends WizardStep {
+    protected class DynRealms extends WizardStep {

Review Comment:
   ## Inner class could be static
   
   DynRealms could be made static, since the enclosing instance is used only in 
its constructor.
   
   [Show more 
details](https://github.com/apache/syncope/security/code-scanning/1312)



##########
client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/role/RoleWizardBuilder.java:
##########
@@ -195,29 +209,29 @@
         }
     }
 
-    protected static class DynRealms extends WizardStep {
+    protected class DynRealms extends WizardStep {
 
         private static final long serialVersionUID = 6846234574424462255L;
 
         public DynRealms(final RoleTO modelObject) {
             setTitleModel(new ResourceModel("dynRealms"));
             add(new AjaxPalettePanel.Builder<>().build("dynRealms",
                     new PropertyModel<>(modelObject, "dynRealms"),
-                    new ListModel<>(DynRealmRestClient.list().stream().
+                    new ListModel<>(dynRealmRestClient.list().stream().
                             
map(DynRealmTO::getKey).collect(Collectors.toList()))).
                     hideLabel().setOutputMarkupId(true));
         }
     }
 
-    protected static class Privileges extends WizardStep {
+    protected class Privileges extends WizardStep {

Review Comment:
   ## Inner class could be static
   
   Privileges could be made static, since the enclosing instance is used only 
in its constructor.
   
   [Show more 
details](https://github.com/apache/syncope/security/code-scanning/1314)



##########
client/idrepo/console/src/main/java/org/apache/syncope/client/console/notifications/NotificationWizardBuilder.java:
##########
@@ -157,7 +173,7 @@
 
     }
 
-    public static class Events extends WizardStep {
+    public class Events extends WizardStep {

Review Comment:
   ## Inner class could be static
   
   Events could be made static, since the enclosing instance is used only in 
its constructor.
   
   [Show more 
details](https://github.com/apache/syncope/security/code-scanning/1310)



##########
client/idrepo/console/src/main/java/org/apache/syncope/client/console/tasks/TaskDirectoryPanel.java:
##########
@@ -84,22 +85,22 @@
 
     protected abstract void viewTaskExecs(T taskTO, AjaxRequestTarget target);
 
-    protected abstract static class TasksProvider<T extends TaskTO> extends 
DirectoryDataProvider<T> {
+    protected abstract class TasksProvider<T extends TaskTO> extends 
DirectoryDataProvider<T> {

Review Comment:
   ## Unused classes and interfaces
   
   Unused class: TasksProvider is not referenced within this codebase. If not 
used as an external API it should be removed.
   
   [Show more 
details](https://github.com/apache/syncope/security/code-scanning/1317)



##########
client/idrepo/console/src/main/java/org/apache/syncope/client/console/pages/NetworkServices.java:
##########
@@ -24,17 +24,22 @@
 import java.util.stream.Stream;
 import org.apache.syncope.client.console.BookmarkablePageLinkBuilder;
 import org.apache.syncope.client.console.panels.NetworkServiceDirectoryPanel;
+import org.apache.syncope.client.console.rest.SyncopeRestClient;
 import org.apache.syncope.common.keymaster.client.api.model.NetworkService;
 import org.apache.wicket.extensions.markup.html.tabs.AbstractTab;
 import org.apache.wicket.extensions.markup.html.tabs.ITab;
 import org.apache.wicket.markup.html.WebMarkupContainer;
 import org.apache.wicket.model.Model;
 import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.wicket.spring.injection.annot.SpringBean;
 
 public class NetworkServices extends BasePage {
 
     private static final long serialVersionUID = -4562707092152823781L;
 
+    @SpringBean
+    protected SyncopeRestClient syncopeRestClient;

Review Comment:
   ## Field masks field in super class
   
   This field shadows another field called [syncopeRestClient](1) in a 
superclass.
   
   [Show more 
details](https://github.com/apache/syncope/security/code-scanning/1319)



##########
client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/AbstractAttrs.java:
##########
@@ -40,12 +40,17 @@
 import org.apache.wicket.markup.head.OnDomReadyHeaderItem;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.util.ListModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
 
 public abstract class AbstractAttrs<S extends SchemaTO> extends 
AbstractAttrsWizardStep<S> {
 
     private static final long serialVersionUID = -5387344116983102292L;
 
-    private final GroupRestClient groupRestClient = new GroupRestClient();
+    @SpringBean
+    protected AnyTypeClassRestClient anyTypeClassRestClient;

Review Comment:
   ## Field masks field in super class
   
   This field shadows another field called [anyTypeClassRestClient](1) in a 
superclass.
   
   [Show more 
details](https://github.com/apache/syncope/security/code-scanning/1320)



##########
client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/role/RoleWizardBuilder.java:
##########
@@ -136,7 +150,7 @@
         }
     }
 
-    protected static class Entitlements extends WizardStep {
+    protected class Entitlements extends WizardStep {

Review Comment:
   ## Inner class could be static
   
   Entitlements could be made static, since the enclosing instance is used only 
in its constructor.
   
   [Show more 
details](https://github.com/apache/syncope/security/code-scanning/1313)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to