treasure-data/embulk-input-jira

View on GitHub

Showing 10 of 15 total issues

Method manipulatingFlattenJson has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

    private void manipulatingFlattenJson(final JsonElement in, final String prefix)
    {
        if (in.isJsonObject()) {
            final JsonObject obj = in.getAsJsonObject();
            // NOTE: If you want to flatten JSON completely, please remove this if and addHeuristicValue
Severity: Minor
Found in src/main/java/org/embulk/input/jira/Issue.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

Method addRecord has 88 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static void addRecord(final Issue issue, final Schema schema, final PluginTask task, final PageBuilder pageBuilder)
    {
        schema.visitColumns(new ColumnVisitor() {
            @Override
            public void jsonColumn(final Column column)
Severity: Major
Found in src/main/java/org/embulk/input/jira/util/JiraUtil.java - About 3 hrs to fix

    Method searchJiraAPI has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private String searchJiraAPI(final PluginTask task, final int startAt, final int maxResults)
        {
            try {
                return RetryExecutor.builder()
                        .withRetryLimit(task.getRetryLimit())
    Severity: Major
    Found in src/main/java/org/embulk/input/jira/client/JiraClient.java - About 2 hrs to fix

      Method manipulatingFlattenJson has 49 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private void manipulatingFlattenJson(final JsonElement in, final String prefix)
          {
              if (in.isJsonObject()) {
                  final JsonObject obj = in.getAsJsonObject();
                  // NOTE: If you want to flatten JSON completely, please remove this if and addHeuristicValue
      Severity: Minor
      Found in src/main/java/org/embulk/input/jira/Issue.java - About 1 hr to fix

        Method get has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

            private JsonElement get(final JsonElement json, final List<String> keys)
            {
                if (json == null || json.isJsonNull()) {
                    return JsonNull.INSTANCE;
                }
        Severity: Minor
        Found in src/main/java/org/embulk/input/jira/Issue.java - 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

        Method validateTaskConfig has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static void validateTaskConfig(final PluginTask task)
            {
                final String username = task.getUsername();
                if (isNullOrEmpty(username)) {
                    throw new ConfigException("Username or email could not be empty");
        Severity: Minor
        Found in src/main/java/org/embulk/input/jira/util/JiraUtil.java - About 1 hr to fix

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

              @Override
              public ConfigDiff transaction(final ConfigSource config,
                      final InputPlugin.Control control)
              {
                  final PluginTask task = CONFIG_MAPPER.map(config, PluginTask.class);
          Severity: Minor
          Found in src/main/java/org/embulk/input/jira/JiraInputPlugin.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 addHeuristicValue has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              private void addHeuristicValue(final JsonObject json, final String prefix)
              {
                  final List<String> keys = Arrays.asList("name", "key", "id");
                  final List<String> heuristic = new ArrayList<>();
                  for (final Entry<String, JsonElement> entry : json.entrySet()) {
          Severity: Minor
          Found in src/main/java/org/embulk/input/jira/Issue.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 validateTaskConfig has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              public static void validateTaskConfig(final PluginTask task)
              {
                  final String username = task.getUsername();
                  if (isNullOrEmpty(username)) {
                      throw new ConfigException("Username or email could not be empty");
          Severity: Minor
          Found in src/main/java/org/embulk/input/jira/util/JiraUtil.java - 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 createGuessSample has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              private List<LinkedHashMap<String, Object>> createGuessSample(final List<Issue> issues, final Set<String> uniqueAttributes)
              {
                  final List<LinkedHashMap<String, Object>> samples = new ArrayList<>();
                  for (final Issue issue : issues) {
                      final JsonObject flatten = issue.getFlatten();
          Severity: Minor
          Found in src/main/java/org/embulk/input/jira/JiraInputPlugin.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

          Severity
          Category
          Status
          Source
          Language