# Source Code Censored/Masked in File Viewer After SonarQube Scan

**URL:** <https://community.sonarsource.com/t/source-code-censored-masked-in-file-viewer-after-sonarqube-scan/189095>\
**Category:** SonarQube Server / Community Build\
**Tags:** coverage, scanner\
**Created:** [September 30, 2026, 7:01am UTC](https://community.sonarsource.com/t/source-code-censored-masked-in-file-viewer-after-sonarqube-scan/189095 "2026-09-30T07:01:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shotgunxq](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/shotgunxq/32/77674_2.png) [@shotgunxq](https://community.sonarsource.com/u/shotgunxq)\
**Post date:** [September 30, 2026, 7:01am UTC](https://community.sonarsource.com/t/source-code-censored-masked-in-file-viewer-after-sonarqube-scan/189095/1 "2026-09-30T07:01:59Z")

</div>

## 

**Versions:**

- SonarQube Server: v26.9.0.129388
- SonarQube Scanner: Maven Plugin 5.8.0.7211
- Java: 25.0.2 (Azul Systems)
- OS: Mac OS X 26.6.2 (aarch64)

**Deployment:**

- 

 ![Screenshot 2026-09-30 at 08.56.58](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/1/0/1015716364118e4c37188248badcb0e80a7fa48e.png)

Localhost deployment ([http://localhost:9000](http://localhost:9000))

### What I’m Trying to Achieve

View the source code of a specific Java file (`OTMSServer.java`) in the SonarQube UI after a successful Maven scan. The file should display with readable code for analysis purposes.

### Current Problem

After running a SonarQube analysis via Maven, when I navigate to view the `OTMSServer.java` file in the SonarQube UI:

- **All source code lines are censored/masked with asterisks (`*` and `*****`)**
- Some lines display purple/magenta asterisks instead of white
- The file is completely unreadable
- Other files in the same project display normally
- **This issue is specific to this one file only**

### What I’ve Tried

1. **Disabled Secrets Analysis:**

2. **Checked Security Hotspots & Issues:**

3. **Verified Permissions:**

4. **Browser & Cache:**

5. **Scan Commands Tested:**

6. **Other Attempts:**

### Expected Behavior

The source code should be fully readable in the file viewer, showing all code lines without masking, allowing me to analyze the cyclomatic complexity and other metrics.

### Question

Is this expected behavior for a specific type of file content, or is there a configuration setting that’s causing this selective masking on a per-file basis? How can I disable source code masking for files analyzed on a local SonarQube instance?

* * *

This format should help the SonarQube community provide better assistance!

Ask

Explain

Today at 08:57

add to it that even the comments are censored, and i even tried to scan that one specific file not the whole monolith of the project but still did not made any change

![Advantage Assist](https://dub1.discourse-cdn.com/sonarsource/api/v1/models/model/profile/image?id=advantage_assist.advantage-assist&lang=en-GB)

Advantage Assist

Today at 08:57

Used claude-haiku-4-5

Here’s the updated community forum post:

* * *

## Source Code Censored/Masked in File Viewer After SonarQube Scan

### Must-share Information

**Versions:**

- SonarQube Server: (Please specify - check Administration → System)
- SonarQube Scanner: Maven Plugin 5.8.0.7211
- Java: 25.0.2 (Azul Systems)
- OS: Mac OS X 26.6.2 (aarch64)

**Deployment:**

- Localhost deployment ([http://localhost:9000](http://localhost:9000))

### What I’m Trying to Achieve

View the source code of a specific Java file (`OTMSServer.java`) in the SonarQube UI after a successful Maven scan. The file should display with readable code for analysis purposes.

### Current Problem

After running a SonarQube analysis via Maven, when I navigate to view the `OTMSServer.java` file in the SonarQube UI:

- **All source code lines are censored/masked with asterisks (`*` and `*****`)**
- **Even comments are censored/masked** - not just code, but ALL content on those lines
- Some lines display purple/magenta asterisks instead of white
- The file is completely unreadable
- Other files in the same project display normally
- **This issue is specific to this one file only**

### What I’ve Tried

1. **Disabled Secrets Analysis:**

2. **Checked Security Hotspots & Issues:**

3. **Verified Permissions:**

4. **Browser & Cache:**

5. **Isolated File Scanning:**

6. **Scan Commands Tested:**

7. **Other Attempts:**

### Key Observations

- **Comments are also masked** - not just sensitive code patterns, suggesting this isn’t standard secret detection
- **Selective masking** - only affects this specific file, all other files in project are readable
- **Persistent issue** - occurs regardless of scan scope (full project vs. isolated file)
- **No corresponding issues** - no Security Hotspots or vulnerabilities reported that would explain the masking
- **Metrics visible** - analysis metrics like Cyclomatic Complexity are calculated and displayed, but source visibility is blocked

### Expected Behavior

The source code should be fully readable in the file viewer, showing all code lines (including comments) without masking, allowing me to analyze the cyclomatic complexity and other metrics.

### Question

Is this expected behavior for a specific type of file content, or is there a configuration setting that’s causing this selective masking on a per-file basis? Why would comments also be censored if this were normal secret detection? How can I disable source code masking for files analyzed on a local SonarQube instance?

---

<div class="post-metadata">

**Author:** ![andres](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/andres/32/76342_2.png) [@andres](https://community.sonarsource.com/u/andres)\
**Post date:** [October 5, 2026, 8:49am UTC](https://community.sonarsource.com/t/source-code-censored-masked-in-file-viewer-after-sonarqube-scan/189095/2 "2026-10-05T08:49:32Z")

</div>

Hey @shotgunxq, welcome to the Community! Thank you for the detailed report. Just one initial check: could you go to Administration \> Configuration \> General Settings \> Security and check if “Mask detected secret values in source code” (backed by `sonar.security.secretSourceRedaction.enabled`) is enabled or not? If yes, could you disable it and have a look at this file again (you will need to refresh the page)?

---

<div class="post-metadata">

**Author:** ![shotgunxq](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/shotgunxq/32/77674_2.png) [@shotgunxq](https://community.sonarsource.com/u/shotgunxq)\
**Post date:** [October 5, 2026, 11:04am UTC](https://community.sonarsource.com/t/source-code-censored-masked-in-file-viewer-after-sonarqube-scan/189095/3 "2026-10-05T11:04:14Z")

</div>

Hello Andres, thank you for replying.  
I’m struggling to find that setting you’re talking about. Even the search cannot find it. What could be the problem?

 ![Screenshot 2026-10-05 at 13.00.53](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/6/4/64b6a1eb300153d98c819a03b578f562e0ebcbf1.jpeg)

---

<div class="post-metadata">

**Author:** ![andres](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/andres/32/76342_2.png) [@andres](https://community.sonarsource.com/u/andres)\
**Post date:** [October 5, 2026, 11:47am UTC](https://community.sonarsource.com/t/source-code-censored-masked-in-file-viewer-after-sonarqube-scan/189095/4 "2026-10-05T11:47:27Z")

</div>

Hey @shotgunxq, apologies, I realized just now that this setting is not available on SonarQube Community Edition. Okay, in that case, would you be able to try to isolate the issue further? Can you progressively remove code from this file (while checking that the issue still persists along the way) until you’re left with a minimal version of it which still causes this issue and which you can share with us?
