groupdocs-editor/GroupDocs.Editor-for-Java-Dropwizard

View on GitHub

Showing 6 of 8 total issues

EditorConfigurationModel has 24 methods (exceeds 20 allowed). Consider refactoring.
Open

public class EditorConfigurationModel {

    @Valid
    @JsonProperty
    private String filesDirectory;

    Method uploadFile has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected String uploadFile(String documentUrl, InputStream inputStream, FormDataContentDisposition fileDetail, boolean rewrite, Map<String, Object> params) {
            InputStream uploadedInputStream = null;
            String pathname;
            try {
                String fileName;
    Severity: Minor
    Found in src/main/java/com/groupdocs/ui/common/resources/Resources.java - About 1 hr to fix

      Method merge has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          private void merge(Map<String, Object> defaultConfig, Map<String, Object> extConfig) {
              for (String key : defaultConfig.keySet()) {
                  if (extConfig.containsKey(key)) {
                      if (defaultConfig.get(key) instanceof Map) {
                          merge((Map<String, Object>) defaultConfig.get(key), (Map<String, Object>) extConfig.get(key));

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Method main has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public static void main(String[] args) throws Exception {
              if (args == null || args.length == 0 || (args.length == 1 && !COMMANDS.contains(args[0]))) {
                  logger.info("Command is not specified. Use default: server.");
                  args = args.length == 1 ? new String[]{SERVER_COMMAND, args[0]} : new String[]{SERVER_COMMAND, EXTERNAL_CONFIGURATION_FILE};
              }
      Severity: Minor
      Found in src/main/java/com/groupdocs/ui/common/MainService.java - About 45 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Method uploadFile has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          protected String uploadFile(String documentUrl, InputStream inputStream, FormDataContentDisposition fileDetail, boolean rewrite, Map<String, Object> params) {
              InputStream uploadedInputStream = null;
              String pathname;
              try {
                  String fileName;
      Severity: Minor
      Found in src/main/java/com/groupdocs/ui/common/resources/Resources.java - About 45 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

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

          protected String uploadFile(String documentUrl, InputStream inputStream, FormDataContentDisposition fileDetail, boolean rewrite, Map<String, Object> params) {
      Severity: Minor
      Found in src/main/java/com/groupdocs/ui/common/resources/Resources.java - About 35 mins to fix
        Severity
        Category
        Status
        Source
        Language