From e44c110b67bc5b1415499fc1668ffb755cd2face Mon Sep 17 00:00:00 2001
From: vil02 <65706193+vil02@users.noreply.github.com>
Date: Wed, 4 Jun 2025 15:54:35 +0200
Subject: [PATCH 1/2] style: include `SLS_SUSPICIOUS_LOOP_SEARCH`
---
spotbugs-exclude.xml | 3 ---
src/main/java/com/thealgorithms/ciphers/AffineCipher.java | 1 +
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/spotbugs-exclude.xml b/spotbugs-exclude.xml
index 3b77ced1a13e..bcc053611de6 100644
--- a/spotbugs-exclude.xml
+++ b/spotbugs-exclude.xml
@@ -195,9 +195,6 @@
-
-
-
diff --git a/src/main/java/com/thealgorithms/ciphers/AffineCipher.java b/src/main/java/com/thealgorithms/ciphers/AffineCipher.java
index b82681372f2b..5d853e257d86 100644
--- a/src/main/java/com/thealgorithms/ciphers/AffineCipher.java
+++ b/src/main/java/com/thealgorithms/ciphers/AffineCipher.java
@@ -68,6 +68,7 @@ static String decryptCipher(String cipher) {
// then i will be the multiplicative inverse of a
if (flag == 1) {
aInv = i;
+ break;
}
}
for (int i = 0; i < cipher.length(); i++) {
From bf41f22f98a1b74296591631d41c104eb9ef9e2a Mon Sep 17 00:00:00 2001
From: vil02 <65706193+vil02@users.noreply.github.com>
Date: Wed, 4 Jun 2025 15:56:47 +0200
Subject: [PATCH 2/2] style: remove redundant `main` method
---
.../java/com/thealgorithms/ciphers/AffineCipher.java | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/src/main/java/com/thealgorithms/ciphers/AffineCipher.java b/src/main/java/com/thealgorithms/ciphers/AffineCipher.java
index 5d853e257d86..979f18532eaa 100644
--- a/src/main/java/com/thealgorithms/ciphers/AffineCipher.java
+++ b/src/main/java/com/thealgorithms/ciphers/AffineCipher.java
@@ -84,16 +84,4 @@ static String decryptCipher(String cipher) {
return msg.toString();
}
-
- // Driver code
- public static void main(String[] args) {
- String msg = "AFFINE CIPHER";
-
- // Calling encryption function
- String cipherText = encryptMessage(msg.toCharArray());
- System.out.println("Encrypted Message is : " + cipherText);
-
- // Calling Decryption function
- System.out.println("Decrypted Message is: " + decryptCipher(cipherText));
- }
}