From 9390a8b8cd92ccf4622381da9905ef7811aba07b Mon Sep 17 00:00:00 2001 From: Nirzara Ghure <113231114+nirzaraghure@users.noreply.github.com> Date: Thu, 6 Nov 2025 15:35:09 +0530 Subject: [PATCH 1/4] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 000000000..2d5f91327 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,36 @@ +# Maven +- task: Ant@1 + inputs: + buildFile: 'build.xml' + options: + publishJUnitResults: true + testResultsFiles: '**/TEST-*.xml' + javaHomeOption: 'JDKVersion' +# Build your Java project and run tests with Apache Maven. +# Add steps that analyze code, save build artifacts, deploy, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/java + +trigger: +- main + +pool: + vmImage: ubuntu-latest + +steps: +- task: Maven@3 + inputs: + mavenPomFile: 'pom.xml' + mavenOptions: '-Xmx3072m' + javaHomeOption: 'JDKVersion' + jdkVersionOption: '1.11' + jdkArchitectureOption: 'x64' + publishJUnitResults: true + testResultsFiles: '**/surefire-reports/TEST-*.xml' + goals: 'package' + +steps: +- script: | + echo Starting the build + mvn package + displayName: 'Build with Maven' + \ No newline at end of file From e689cfb753503bfac40d3b4772e460892210e86e Mon Sep 17 00:00:00 2001 From: Nirzara Ghure <113231114+nirzaraghure@users.noreply.github.com> Date: Thu, 6 Nov 2025 15:36:09 +0530 Subject: [PATCH 2/4] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines-1.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 azure-pipelines-1.yml diff --git a/azure-pipelines-1.yml b/azure-pipelines-1.yml new file mode 100644 index 000000000..3f7a38da3 --- /dev/null +++ b/azure-pipelines-1.yml @@ -0,0 +1,31 @@ +# Maven +- task: Gradle@4 + inputs: + gradleWrapperFile: 'gradlew' + tasks: 'build' + publishJUnitResults: true + testResultsFiles: '**/TEST-*.xml' + javaHomeOption: 'JDKVersion' + sonarQubeRunAnalysis: false + spotBugsAnalysis: false +# Build your Java project and run tests with Apache Maven. +# Add steps that analyze code, save build artifacts, deploy, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/java + +trigger: +- main + +pool: + vmImage: ubuntu-latest + +steps: +- task: Maven@3 + inputs: + mavenPomFile: 'pom.xml' + mavenOptions: '-Xmx3072m' + javaHomeOption: 'JDKVersion' + jdkVersionOption: '1.11' + jdkArchitectureOption: 'x64' + publishJUnitResults: true + testResultsFiles: '**/surefire-reports/TEST-*.xml' + goals: 'package' From 8cf731f1d9a850c37754498f5d214ab0e39c0339 Mon Sep 17 00:00:00 2001 From: Nirzara Ghure <113231114+nirzaraghure@users.noreply.github.com> Date: Wed, 3 Jun 2026 12:42:40 +0530 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=9B=A1=EF=B8=8F=20AppGenius:=20Securi?= =?UTF-8?q?ty=20scan=20report?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SECURITY_REPORT.md | 116 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 SECURITY_REPORT.md diff --git a/SECURITY_REPORT.md b/SECURITY_REPORT.md new file mode 100644 index 000000000..4045486b8 --- /dev/null +++ b/SECURITY_REPORT.md @@ -0,0 +1,116 @@ +# 🛡️ AppGenius Security Report + +**Repository:** `nirzaraghure/pipelines-java` +**Scan Date:** 6/3/2026, 12:42:39 PM +**Files Scanned:** 2 +**Issues Found:** 5 + +## 📊 Summary + +| Severity | Count | +|----------|-------| +| 🔴 Critical | 0 | +| 🟠 High | 1 | +| 🟡 Medium | 2 | +| 🔵 Low | 2 | + +## 🔍 Detailed Findings + +### 🔵 1. Potential NullPointerException + +**File:** `Demo.java` +**Type:** NullPointerException +**Severity:** LOW + +**Description:** +The method DoSomething can throw a NullPointerException if the input flag is null. + +**Suggested Fix:** +Add a null check for the flag before using it. + +**Code Example:** +``` +public void DoSomething(Boolean flag){ ... } +``` + +--- + +### 🟡 2. No input validation + +**File:** `Demo.java` +**Type:** Information Disclosure +**Severity:** MEDIUM + +**Description:** +The method DoSomething does not validate the input flag. This could potentially lead to information disclosure. + +**Suggested Fix:** +Validate the input flag before using it. + +**Code Example:** +``` +public void DoSomething(Boolean flag){ ... } +``` + +--- + +### 🔵 3. Lack of logging + +**File:** `Demo.java` +**Type:** Logging +**Severity:** LOW + +**Description:** +The method DoSomething does not log any information. This makes it difficult to track the execution flow of the method. + +**Suggested Fix:** +Add logging statements to track the execution flow. + +**Code Example:** +``` +public void DoSomething(Boolean flag){ ... } +``` + +--- + +### 🟠 4. Missing test case + +**File:** `MyTest.java` +**Type:** Test Coverage +**Severity:** HIGH + +**Description:** +The test class MyTest does not contain a test case for the method DoSomething with a flag set to false. + +**Suggested Fix:** +Add a test case for the method DoSomething with a flag set to false. + +**Code Example:** +``` +@Test public void test_method_3() { Demo d = new Demo(); d.DoSomething(false); } +``` + +--- + +### 🟡 5. Empty test method + +**File:** `MyTest.java` +**Type:** Test Coverage +**Severity:** MEDIUM + +**Description:** +The test method test_method_2 is empty. This means it does not test any functionality. + +**Suggested Fix:** +Add test logic to the test method test_method_2. + +**Code Example:** +``` +@Test public void test_method_2() { ... } +``` + +--- + + +--- +*Generated by AppGenius Headless Security Scanner* From 3a9b099cbd9b541ac9a4c3def8e9563a10857dff Mon Sep 17 00:00:00 2001 From: Nirzara Ghure <113231114+nirzaraghure@users.noreply.github.com> Date: Fri, 17 Jul 2026 15:19:04 +0530 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=A4=96=20AppGenius:=20AI-generated=20?= =?UTF-8?q?code=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/microsoft/demo/Demo.test.java | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/main/java/com/microsoft/demo/Demo.test.java diff --git a/src/main/java/com/microsoft/demo/Demo.test.java b/src/main/java/com/microsoft/demo/Demo.test.java new file mode 100644 index 000000000..0b4904282 --- /dev/null +++ b/src/main/java/com/microsoft/demo/Demo.test.java @@ -0,0 +1,35 @@ +package com.microsoft.demo; + +import org.junit.*; + +public class DemoTest { + private Demo demo; + + @Before + public void setUp() throws Exception { + demo = new Demo(); + } + + @After + public void tearDown() throws Exception { + demo = null; + } + + @Test + public void testDoSomethingWithTrueFlag() { + try{ + demo.DoSomething(true); + } catch (Exception e) { + Assert.fail("Expected no exception to be thrown"); + } + } + + @Test + public void testDoSomethingWithFalseFlag() { + try{ + demo.DoSomething(false); + } catch (Exception e) { + Assert.fail("Expected no exception to be thrown"); + } + } +} \ No newline at end of file