xebialabs-community/xlr-ucd-plugin

View on GitHub

Showing 13 of 24 total issues

Method initializeUCD has 158 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static void initializeUCD() throws Exception{
        System.out.println("Starting UCD initialization");

        baseURI = BASE_URI_UCD;
        // Configure authentication
Severity: Major
Found in src/test/java/integration/util/PluginTestHelper.java - About 6 hrs to fix

    Method initializeUCD has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

        public static void initializeUCD() throws Exception{
            System.out.println("Starting UCD initialization");
    
            baseURI = BASE_URI_UCD;
            // Configure authentication
    Severity: Minor
    Found in src/test/java/integration/util/PluginTestHelper.java - About 4 hrs 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

    File PluginTestHelper.java has 316 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * Copyright 2021 XEBIALABS
     *
     * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
     *
    Severity: Minor
    Found in src/test/java/integration/util/PluginTestHelper.java - About 3 hrs to fix

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

          public static org.json.JSONObject getPluginReleaseResult() throws Exception{
              org.json.JSONObject releaseResultJSON = null;
              String responseId = "";
              String releaseResultStr = "";
              // Prepare httpRequest, start the release
      Severity: Minor
      Found in src/test/java/integration/util/PluginTestHelper.java - About 1 hr to fix

        Method initializeXLR has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static void initializeXLR() throws Exception{
        
                // Load ucd server config
               
                try {
        Severity: Minor
        Found in src/test/java/integration/util/PluginTestHelper.java - About 1 hr to fix

          Function ucd_applicationprocessrequeststatus has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              def ucd_applicationprocessrequeststatus(self, variables):
                  #logger.debug("In ucd_applicationprocessrequeststatus")
                  global shouldSupressLogging
          
                  '''        
          Severity: Minor
          Found in src/main/resources/ucd/UCDClient.py - About 55 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

          Function buildRequest has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def buildRequest(self, method, context, body, contentType, headers):
          Severity: Minor
          Found in src/main/resources/ucd/HttpRequest.py - About 35 mins to fix

            Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(self, http_connection, task, username=None, password=None, verify=True):
            Severity: Minor
            Found in src/main/resources/ucd/UCDClient.py - About 35 mins to fix

              Function executeRequest has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def executeRequest(self, request):
                      client = None
                      response = None
                      try:
                          if not self.verify:
              Severity: Minor
              Found in src/main/resources/ucd/HttpRequest.py - About 35 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

              Function buildRequest has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def buildRequest(self, method, context, body, contentType, headers):
                      url = self.quote(self.createPath(self.params.getUrl(), context))
              
                      method = method.upper()
              
              
              Severity: Minor
              Found in src/main/resources/ucd/HttpRequest.py - About 35 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 initializeXLR has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static void initializeXLR() throws Exception{
              
                      // Load ucd server config
                     
                      try {
              Severity: Minor
              Found in src/test/java/integration/util/PluginTestHelper.java - About 25 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 getPluginReleaseResult has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static org.json.JSONObject getPluginReleaseResult() throws Exception{
                      org.json.JSONObject releaseResultJSON = null;
                      String responseId = "";
                      String releaseResultStr = "";
                      // Prepare httpRequest, start the release
              Severity: Minor
              Found in src/test/java/integration/util/PluginTestHelper.java - About 25 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

              Function ucd_applicationprocessrequest has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def ucd_applicationprocessrequest(self, variables):
                      application_process_request_endpoint = "/cli/applicationProcessRequest/request"
                      versions_list = []
                      for component, version in variables['versions'].iteritems():
                          versions_list.append({'version': version, 'component': component})
              Severity: Minor
              Found in src/main/resources/ucd/UCDClient.py - About 25 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

              Severity
              Category
              Status
              Source
              Language