ilscipio/scipio-erp

View on GitHub
applications/content/src/org/ofbiz/content/content/ContentWorker.java

Summary

Maintainability
F
5 days
Test Coverage

ContentWorker has 67 methods (exceeds 20 allowed). Consider refactoring.
Open

public class ContentWorker implements org.ofbiz.widget.content.ContentWorkerInterface {

    private static final Debug.OfbizLogger module = Debug.getOfbizLogger(java.lang.invoke.MethodHandles.lookup().lookupClass());
    static final UtilCodec.SimpleEncoder encoder = UtilCodec.getEncoder("html");

Severity: Major
Found in applications/content/src/org/ofbiz/content/content/ContentWorker.java - About 1 day to fix

    Method renderContentAsText has 12 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public static void renderContentAsText(LocalDispatcher dispatcher, Delegator delegator, String contentId, Appendable out,
                Map<String, Object> templateContext, Locale locale, String mimeTypeId, String partyId, String roleTypeId, Boolean useFallbackLocale, boolean cache, Boolean deepCache) throws GeneralException, IOException {

      Method renderContentAsText has 11 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public static String renderContentAsText(LocalDispatcher dispatcher, Delegator delegator, String contentId, Appendable out,
                  Map<String, Object> templateContext, Locale locale, String mimeTypeId, String partyId, String roleTypeId, boolean cache, List<GenericValue> webAnalytics) throws GeneralException, IOException {

        Method renderContentAsText has 11 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public static void renderContentAsText(LocalDispatcher dispatcher, Delegator delegator, GenericValue content, Appendable out,
                    Map<String,Object>templateContext, Locale locale, String mimeTypeId, Boolean useFallbackLocale, boolean cache, Boolean deepCache, List<GenericValue> webAnalytics) throws GeneralException, IOException {

          Consider simplifying this complex logical expression.
          Open

                  if ((rendered.contains("<script>")
                          || rendered.contains("<!--")
                          || rendered.contains("<div")
                          || rendered.contains("<style>")
                          || rendered.contains("<span")
          Severity: Critical
          Found in applications/content/src/org/ofbiz/content/content/ContentWorker.java - About 1 hr to fix

            Method renderContentAsText has 10 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public static void renderContentAsText(LocalDispatcher dispatcher, Delegator delegator, String contentId, Appendable out,
                        Map<String, Object> templateContext, Locale locale, String mimeTypeId, String partyId, String roleTypeId, boolean cache) throws GeneralException, IOException {

              Method traverse has 10 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public static void traverse(Delegator delegator, GenericValue content, Timestamp fromDate, Timestamp thruDate, Map<String, Object> whenMap, int depthIdx, Map<String, Object> masterNode, String contentAssocTypeId, List<GenericValue> pickList, String direction) {

                Method renderContentAsText has 9 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public static void renderContentAsText(LocalDispatcher dispatcher, Delegator delegator, GenericValue content, Appendable out,
                            Map<String,Object>templateContext, Locale locale, String mimeTypeId, boolean cache, List<GenericValue> webAnalytics) throws GeneralException, IOException {

                  Method renderSubContentAsText has 9 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public static void renderSubContentAsText(LocalDispatcher dispatcher, Delegator delegator, String contentId, Appendable out, String mapKey,
                              Map<String,Object> templateContext, Locale locale, String mimeTypeId, boolean cache) throws GeneralException, IOException {

                    Method renderSubContentAsTextExt has 9 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public void renderSubContentAsTextExt(LocalDispatcher dispatcher, Delegator delegator, String contentId, Appendable out, String mapKey, Map<String, Object> templateContext, Locale locale, String mimeTypeId, boolean cache) throws GeneralException, IOException {

                      Method getSubContentCache has 9 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          public static GenericValue getSubContentCache(Delegator delegator, String contentId, String mapKey, String subContentId, GenericValue userLogin, List<String> assocTypes, Timestamp fromDate, Boolean nullThruDatesOnly, String contentAssocPredicateId) throws GenericEntityException {

                        Method getSubContentCache has 8 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            public static GenericValue getSubContentCache(Delegator delegator, String contentId, String mapKey, GenericValue userLogin, List<String> assocTypes, Timestamp fromDate, Boolean nullThruDatesOnly, String contentAssocPredicateId) throws GenericEntityException {

                          Method findContentForRendering has 8 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              public static GenericValue findContentForRendering(Delegator delegator, String contentId, Locale locale, String partyId, String roleTypeId, Boolean useFallbackLocale, boolean cache, Boolean deepCache) throws GeneralException, IOException {

                            Method renderContentAsTextExt has 8 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                public void renderContentAsTextExt(LocalDispatcher dispatcher, Delegator delegator, String contentId, Appendable out, Map<String, Object> templateContext, Locale locale, String mimeTypeId, boolean cache) throws GeneralException, IOException {

                              Method renderSubContentAsTextExt has 8 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  public String renderSubContentAsTextExt(LocalDispatcher dispatcher, Delegator delegator, String contentId, String mapKey, Map<String, Object> templateContext, Locale locale, String mimeTypeId, boolean cache) throws GeneralException, IOException {

                                Method renderSubContentAsText has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    public static String renderSubContentAsText(LocalDispatcher dispatcher, Delegator delegator, String contentId, String mapKey, Map<String, Object> templateContext,
                                            Locale locale, String mimeTypeId, boolean cache) throws GeneralException, IOException {

                                  Method getSubContent has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      public static GenericValue getSubContent(Delegator delegator, String contentId, String mapKey, String subContentId, GenericValue userLogin, List<String> assocTypes, Timestamp fromDate) throws IOException {
                                  Severity: Major
                                  Found in applications/content/src/org/ofbiz/content/content/ContentWorker.java - About 50 mins to fix

                                    Method renderContentAsText has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        public static String renderContentAsText(LocalDispatcher dispatcher, Delegator delegator, String contentId, Map<String, Object> templateContext, Locale locale,
                                                String mimeTypeId, boolean cache) throws GeneralException, IOException {
                                    Severity: Major
                                    Found in applications/content/src/org/ofbiz/content/content/ContentWorker.java - About 50 mins to fix

                                      Method renderContentAsTextExt has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          public String renderContentAsTextExt(LocalDispatcher dispatcher, Delegator delegator, String contentId, Map<String, Object> templateContext, Locale locale, String mimeTypeId, boolean cache) throws GeneralException, IOException {
                                      Severity: Major
                                      Found in applications/content/src/org/ofbiz/content/content/ContentWorker.java - About 50 mins to fix

                                        Method getCurrentContentExt has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                            public GenericValue getCurrentContentExt(Delegator delegator, List<Map<String, ? extends Object>> trail, GenericValue userLogin, Map<String, Object> ctx, Boolean nullThruDatesOnly, String contentAssocPredicateId) throws GeneralException {
                                        Severity: Minor
                                        Found in applications/content/src/org/ofbiz/content/content/ContentWorker.java - About 45 mins to fix

                                          Method getContentAssocsWithId has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                          Open

                                              public static List<GenericValue> getContentAssocsWithId(Delegator delegator, String contentId, Timestamp fromDate, Timestamp thruDate, String direction, List<String> assocTypes) throws GenericEntityException {
                                          Severity: Minor
                                          Found in applications/content/src/org/ofbiz/content/content/ContentWorker.java - About 45 mins to fix

                                            Method determineMimeType has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                            Open

                                                public static String determineMimeType(Delegator delegator, GenericValue view, GenericValue parentContent, String contentId, String dataResourceId, String parentContentId) throws GenericEntityException {
                                            Severity: Minor
                                            Found in applications/content/src/org/ofbiz/content/content/ContentWorker.java - About 45 mins to fix

                                              Avoid deeply nested control flow statements.
                                              Open

                                                                      if (inProgress) {
                                                                          break;
                                                                      }
                                              Severity: Major
                                              Found in applications/content/src/org/ofbiz/content/content/ContentWorker.java - About 45 mins to fix

                                                Method findContentForRendering has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                Open

                                                    public static GenericValue findContentForRendering(Delegator delegator, String contentId, Locale locale, String partyId, String roleTypeId, boolean cache) throws GeneralException, IOException {
                                                Severity: Minor
                                                Found in applications/content/src/org/ofbiz/content/content/ContentWorker.java - About 45 mins to fix

                                                  Method getCurrentContent has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                  Open

                                                      public static GenericValue getCurrentContent(Delegator delegator, List<Map<String, ? extends Object>> trail, GenericValue userLogin, Map<String, Object> ctx, Boolean nullThruDatesOnly, String contentAssocPredicateId)  throws GeneralException {
                                                  Severity: Minor
                                                  Found in applications/content/src/org/ofbiz/content/content/ContentWorker.java - About 45 mins to fix

                                                    Method getAssociatedContent has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                    Open

                                                        public static List<GenericValue> getAssociatedContent(GenericValue currentContent, String linkDir, List<String> assocTypes, List<String> contentTypes, String fromDate, String thruDate) throws GenericEntityException {
                                                    Severity: Minor
                                                    Found in applications/content/src/org/ofbiz/content/content/ContentWorker.java - About 45 mins to fix

                                                      Method getContentAssocViewList has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                      Open

                                                          public static List<GenericValue> getContentAssocViewList(Delegator delegator, String contentIdTo, String contentId, String contentAssocTypeId, String statusId, String privilegeEnumId) throws GenericEntityException {
                                                      Severity: Minor
                                                      Found in applications/content/src/org/ofbiz/content/content/ContentWorker.java - About 45 mins to fix

                                                        Method getAssociatedContentView has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                        Open

                                                            public static List<GenericValue> getAssociatedContentView(GenericValue currentContent, String linkDir, List<String> assocTypes, List<String> contentTypes, String fromDate, String thruDate) throws GenericEntityException {
                                                        Severity: Minor
                                                        Found in applications/content/src/org/ofbiz/content/content/ContentWorker.java - About 45 mins to fix

                                                          Method getContentAssocViewFrom has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                          Open

                                                              public static GenericValue getContentAssocViewFrom(Delegator delegator, String contentIdTo, String contentId, String contentAssocTypeId, String statusId, String privilegeEnumId) throws GenericEntityException {
                                                          Severity: Minor
                                                          Found in applications/content/src/org/ofbiz/content/content/ContentWorker.java - About 45 mins to fix

                                                            Method findAlternateLocaleContent has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                            Open

                                                                public static GenericValue findAlternateLocaleContent(Delegator delegator, GenericValue view, Locale locale, Boolean useFallbackLocale, boolean cache) { // SCIPIO: 2017-11-24: added cache
                                                            Severity: Minor
                                                            Found in applications/content/src/org/ofbiz/content/content/ContentWorker.java - About 35 mins to fix

                                                              Method getContentAncestryValues has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                              Open

                                                                  public static void getContentAncestryValues(Delegator delegator, String contentId, String contentAssocTypeId, String direction, List<GenericValue> contentAncestorList) throws GenericEntityException {
                                                              Severity: Minor
                                                              Found in applications/content/src/org/ofbiz/content/content/ContentWorker.java - About 35 mins to fix

                                                                Method getContentAncestry has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                Open

                                                                    public static void getContentAncestry(Delegator delegator, String contentId, String contentAssocTypeId, String direction, List<GenericValue> contentAncestorList) throws GenericEntityException {
                                                                Severity: Minor
                                                                Found in applications/content/src/org/ofbiz/content/content/ContentWorker.java - About 35 mins to fix

                                                                  Method getContentAncestryAll has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                  Open

                                                                      public static void getContentAncestryAll(Delegator delegator, String contentId, String passedContentTypeId, String direction, List<String> contentAncestorList) {
                                                                  Severity: Minor
                                                                  Found in applications/content/src/org/ofbiz/content/content/ContentWorker.java - About 35 mins to fix

                                                                    Method buildPickContext has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                    Open

                                                                        public static Map<String, Object> buildPickContext(Delegator delegator, String contentAssocTypeId, String assocContentId, String direction, GenericValue thisContent) throws GenericEntityException {
                                                                    Severity: Minor
                                                                    Found in applications/content/src/org/ofbiz/content/content/ContentWorker.java - About 35 mins to fix

                                                                      Method getAssociations has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                      Open

                                                                          public static List<GenericValue> getAssociations(GenericValue currentContent, String linkDir, List<String> assocTypes, String strFromDate, String strThruDate) throws GenericEntityException {
                                                                      Severity: Minor
                                                                      Found in applications/content/src/org/ofbiz/content/content/ContentWorker.java - About 35 mins to fix

                                                                        There are no issues that match your filters.

                                                                        Category
                                                                        Status