xebialabs-community/xlr-servicenow-plugin

View on GitHub

Showing 4 of 14 total issues

Function ServiceNowQueryTileViewController has 136 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var ServiceNowQueryTileViewController = function ($scope, ServiceNowQueryService, XlrTileHelper) {
        var vm = this;
        var tile;
        var config;
        var predefinedColors = [];

    Function load has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            function load(config) {
                if (tileConfigurationIsPopulated()) {
                    vm.loading = true;
                    ServiceNowQueryService.executeQuery(tile.id, config).then(
                        function (response) {

      Function print_record has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          def print_record(self, myObj, outStr="", prefix="", header=True):
              if header:
                  outStr = "%s| Key | Value |\n" % (outStr)
                  outStr = "%s| --- | --- |\n" % (outStr)
              if type(myObj) is dict:
      Severity: Minor
      Found in src/main/resources/servicenow/ServiceNowClient.py - About 1 hr 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 get_row_data has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      def get_row_data(item):
          row_map = {}
          for column in detailsViewColumns:
              if detailsViewColumns[column] and "." in detailsViewColumns[column]:
                  json_col = detailsViewColumns[column].split('.')
      Severity: Minor
      Found in src/main/resources/servicenow/ServiceNowQueryTile.py - 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

      Severity
      Category
      Status
      Source
      Language