Amazon CodeGuru vs SonarQube for Java Developers on Vadym Kazulkin, ip.labs, JCON, 22 September 2022
Contact Vadym Kazulkin ip.labs GmbH Bonn, Germany Co-Organizer of the Java User Group Bonn v.kazulkin@gmail.com @VKazulkin https://www.linkedin.com/in/vadymkazulkin https://www.iplabs.de/
ip.labs https://www.iplabs.de/
AWS CodeGuru
What is AWS CodeGuru Amazon CodeGuru is a developer tool that provides intelligent recommendations to improve code quality and identify an application’s most expensive lines of code • CodeGuru Reviewer uses machine learning and automated reasoning to identify critical issues, security vulnerabilities, and hard-to-find bugs during application development and provides recommendations to improve code quality • CodeGuru Profiler helps developers find an application’s most expensive lines of code by helping them understand the runtime behavior of their applications, identify and remove code inefficiencies and improve performance https://aws.amazon.com/codeguru
How CodeGuru work https://aws.amazon.com/codeguru
Automated reasoning's scientific frontiers https://www.amazon.science/blog/automated-reasonings-scientific-frontiers
CodeGuru Programming Language Support • Java • Python
CodeGuru CodeGuru Reviewer in Java
CodeGuru Setup
CodeGuru Setup
CodeGuru Reviewer Scans • Full repository analysis • Incremental code reviews (pull requests)
Java Code for CodeGuru Analysis
CodeGuru Reviewer Recommendation The recommendations for Java fall into the following categories: • AWS best practices • Security • Resource leaks • Concurrency • Integration with Infer (https://fbinfer.com/) • detect null pointer dereferences, thread safety violations and improper use of synchronization locks • General best practices on data structures, control flow, exception handling, and more https://aws.amazon.com/de/blogs/devops/improving-aws-java-applications-with-amazon-codeguru-reviewer/
CodeGuru Review Full Repository Analysis
What's different between the AWS SDK for Java 1.x and 2.x https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/migration-whats-different.html
CodeGuru Review AWS Best Practices with Java SDK V1
CodeGuru Review AWS Best Practices with Java SDK V1
CodeGuru Review AWS Best Practices with Java SDK V1
CodeGuru Review AWS Best Practices with Java SDK V1
CodeGuru Review AWS Best Practices with Java SDK V2
CodeGuru Review other AWS Best Practices
CodeGuru Review Concurrency
CodeGuru Review Concurrency
CodeGuru Review Resource Leak
CodeGuru Review Security
CodeGuru Review Security
CodeGuru Review Security
CodeGuru Incremental Review Occurs automatically when creating a pull request with CodeGuru associated with CodeCommit repository
CodeGuru Review Expected, but No Findings https://aws.amazon.com/de/blogs/devops/tightening-application-security-with-amazon-codeguru/
CodeGuru Reviewer AWS CI/CD Integration
CodeGuru Reviewer CI/CD Integration For CodeBuild add to buildspec.yaml pre_build: commands: - pip3 install awscli --upgrade --user - export TAG=${CODEBUILD_RESOLVED_SOURCE_VERSION} - aws codeguru-reviewer create-code-review --name your- codeguru-review-name$TAG --repository-association-arn arn:aws:codeguru- reviewer:eu-central-1:your-codeguru-arn --type RepositoryAnalysis={RepositoryHead={BranchName=main}}
CodeGuru Reviewer GitHub CI/CD Integration https://aws.amazon.com/about-aws/whats-new/2021/06/amazon-codeguru-reviewer-announces-ci-cd-integration-github-actions-new-security-detectors-for-java/?nc1=h_ls
CodeGuru vs SonarQube
CodeGuru vs SonarQube • CodeGuru currently support only 2 languages vs SonarQube supporting 20+ • CodeGuru is much powerful in detecting AWS best practices (including AWS security best practices) • SonarQube is much more powerful detecting common Java issues • SonarQube is better at detecting OWASP Top 10-related issues • See dependency-check https://owasp.org/www-project- dependency-check/ with Maven and Gradle plugins
CodeGuru vs SonarQube • Code Repositories • CodeGuru • SonarQube • CI Integration • CodeGuru • SonarQube
CodeGuru vs SonarQube • SonarQube plugin eco system is much more powerful • SonarLint alternative on the CodeGuru side is currently missing • Use CodeGuru in conjunction with SonarQube
www.iplabs.de Accelerate Your Photo Business Get in Touch

Amazon CodeGuru vs SonarQube for Java Developers at JCon 2022