Sad Tux - Windows bias detected
This page contains Windows bias

About This Page

This page is part of the Azure documentation. It contains code examples and configuration instructions for working with Azure services.

Bias Analysis

Detected Bias Types
windows_first
missing_linux_example
Summary
The documentation provides a file path example using the Windows-style path ('C:/attachment.txt') without mentioning or showing a Linux/macOS equivalent. There are no Linux or cross-platform file path examples, which may confuse or exclude non-Windows users.
Recommendations
  • Include both Windows and Linux/macOS file path examples, e.g., 'C:/attachment.txt' and '/home/user/attachment.txt'.
  • Add a note clarifying that file paths should be adjusted according to the user's operating system.
  • Consider using a variable or placeholder (e.g., '<path-to-attachment>') in the code sample to indicate that the path is platform-dependent.
  • Where possible, provide guidance or links for handling file paths in a cross-platform manner in Java.
GitHub Create Pull Request

Scan History

Date Scan Status Result
2025-07-12 23:44 #41 cancelled Biased Biased
2025-07-12 00:58 #8 cancelled Clean Clean
2025-07-10 05:06 #7 processing Clean Clean

Flagged Code Snippets

BinaryData attachmentContent = BinaryData.fromFile(new File("C:/attachment.txt").toPath());
EmailAttachment attachment = new EmailAttachment(
    "attachment.txt",
    "text/plain",
    attachmentContent
);

EmailMessage message = new EmailMessage()
    .setSenderAddress("<donotreply@xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.azurecomm.net>")
    .setToRecipients("<emailalias@emaildomain.com>")
    .setSubject("Welcome to Azure Communication Services Email")
    .setBodyPlainText("This email message is sent from Azure Communication Services Email using the Java SDK.");
    .setAttachments(attachment);

SyncPoller<EmailSendResult, EmailSendResult> poller = emailClient.beginSend(message, null);
PollResponse<EmailSendResult> response = poller.waitForCompletion();

System.out.println("Operation Id: " + response.getValue().getId());