Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 116 additions & 0 deletions SECURITY_REPORT.md
Original file line number Diff line number Diff line change
@@ -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*
31 changes: 31 additions & 0 deletions azure-pipelines-1.yml
Original file line number Diff line number Diff line change
@@ -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'
36 changes: 36 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -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'

35 changes: 35 additions & 0 deletions src/main/java/com/microsoft/demo/Demo.test.java
Original file line number Diff line number Diff line change
@@ -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");
}
}
}