[ aws . codeguru-reviewer ]

list-recommendations

Description

Returns the list of all recommendations for a completed code review.

See also: AWS API Documentation

See ‘aws help’ for descriptions of global parameters.

Synopsis

  list-recommendations
[--next-token <value>]
[--max-results <value>]
--code-review-arn <value>
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]

Options

--next-token (string)

Pagination token.

--max-results (integer)

The maximum number of results that are returned per call. The default is 100.

--code-review-arn (string)

The Amazon Resource Name (ARN) of the ` CodeReview https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReview.html`__ object.

--cli-input-json | --cli-input-yaml (string) Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with --cli-input-yaml.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. Similarly, if provided yaml-input it will print a sample input YAML that can be used with --cli-input-yaml. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See ‘aws help’ for descriptions of global parameters.

Examples

To list the recommendations for a completed code review

The following list-recommendations example lists the recommendations for a comleted code review. This code review has one recommendations.

aws codeguru-reviewer list-recommendations \
    --code-review-arn arn:aws:codeguru-reviewer:us-west-2:544120495673:code-review:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111

Output:

{
    "RecommendationSummaries": [
        {
            "Description": "\n\n**Problem**  \n You are using a `ConcurrentHashMap`, but your usage of `containsKey()` and `get()` may not be thread-safe at lines: **63 and 64**. In between the check and the `get()` another thread can remove the key and the `get()` will return `null`. The remove that can remove the key is at line: **59**.\n\n**Fix**  \n Consider calling `get()`, checking instead of your current check if the returned object is `null`, and then using that object only, without calling `get()` again.\n\n**More info**  \n [View an example on GitHub](https://github.com/apache/hadoop/blob/f16cf877e565084c66bc63605659b157c4394dc8/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/S3Guard.java#L302-L304) (external link).",
            "RecommendationId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222",
            "StartLine": 63,
            "EndLine": 64,
            "FilePath": "src/main/java/com/company/sample/application/CreateOrderThread.java"
        }
    ]
}

For more information, see `ListRecommendations<https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRecommendations.html>`__ in the Amazon DevOps Guru API Reference.

Output

RecommendationSummaries -> (list)

List of recommendations for the requested code review.

(structure)

Information about recommendations.

FilePath -> (string)

Name of the file on which a recommendation is provided.

RecommendationId -> (string)

The recommendation ID that can be used to track the provided recommendations. Later on it can be used to collect the feedback.

StartLine -> (integer)

Start line from where the recommendation is applicable in the source commit or source branch.

EndLine -> (integer)

Last line where the recommendation is applicable in the source commit or source branch. For a single line comment the start line and end line values are the same.

Description -> (string)

A description of the recommendation generated by CodeGuru Reviewer for the lines of code between the start line and the end line.

NextToken -> (string)

Pagination token.