Fix sonarqube issues

This commit is contained in:
2026-01-26 22:23:05 -05:00
parent 1943f19b4e
commit 8e41b0a2ad
34 changed files with 1885 additions and 2081 deletions

View File

@@ -1,23 +1,3 @@
//CipherStreamJava/src/main/java/com/mattrixwv/CipherStreamJava/Exceptions/InvalidBaseException.java
//Mattrixwv
// Created: 01-09-22
//Modified: 08-11-24
/*
Copyright (C) 2024 Mattrixwv
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.mattrixwv.cipherstream.exceptions;

View File

@@ -1,23 +1,3 @@
//CipherStreamJava/src/main/java/com/mattrixwv/CipherStreamJava/Exceptions/InvalidCharacterException.java
//Mattrixwv
// Created: 01-04-22
//Modified: 08-11-24
/*
Copyright (C) 2024 Mattrixwv
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.mattrixwv.cipherstream.exceptions;

View File

@@ -1,23 +1,3 @@
//CipherStreamJava/src/main/java/com/mattrixwv/CipherStreamJava/Exceptions/InvalidInputException.java
//Mattrixwv
// Created: 01-09-22
//Modified: 08-11-24
/*
Copyright (C) 2024 Mattrixwv
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.mattrixwv.cipherstream.exceptions;

View File

@@ -1,23 +1,3 @@
//CipherStreamJava/src/main/java/com/mattrixwv/cipherstream/exceptions/InvalidKeyException.java
//Matrixwv
// Created: 07-09-22
//Modified: 08-11-24
/*
Copyright (C) 2024 Mattrixwv
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.mattrixwv.cipherstream.exceptions;

View File

@@ -1,23 +1,3 @@
//CipherStreamJava/src/main/java/com/mattrixwv/CipherStreamJava/Exceptions/InvalidKeywordException.java
//Mattrixwv
// Created: 01-09-22
//Modified: 08-11-24
/*
Copyright (C) 2024 Mattrixwv
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.mattrixwv.cipherstream.exceptions;

View File

@@ -44,6 +44,11 @@ public final class Caesar{
logger.debug("Setting shift {}", shiftAmount);
//If you shift more than 26 you will just be wrapping back around again
if(shiftAmount < 0){
logger.debug("Negative shift detected, converting to positive equivalent");
shiftAmount += 26;
}
shift = shiftAmount % 26;
logger.debug("Cleaned shift {}", shift);
@@ -100,7 +105,7 @@ public final class Caesar{
if(Character.isUpperCase(currentChar)){
logger.debug("Encoding uppercase");
currentChar = (char)((int)currentChar + shift);
currentChar = (char)(currentChar + shift);
//Wrap around if the letter is now out of bounds
if(currentChar < 'A'){
logger.debug("Wrapping around to Z");
@@ -115,7 +120,7 @@ public final class Caesar{
else if(Character.isLowerCase(currentChar)){
logger.debug("Encoding lowercase");
currentChar = (char)((int)currentChar + shift);
currentChar = (char)(currentChar + shift);
//Wrap around if the letter is now out of bounds
if(currentChar < 'a'){
logger.debug("Wrapping around to z");
@@ -150,7 +155,7 @@ public final class Caesar{
if(Character.isUpperCase(currentChar)){
logger.debug("Decoding uppercase");
currentChar = (char)((int)currentChar - shift);
currentChar = (char)(currentChar - shift);
//Wrap around if the letter is now out of bounds
if(currentChar < 'A'){
logger.debug("Wrapping around to Z");
@@ -167,7 +172,7 @@ public final class Caesar{
else if(Character.isLowerCase(currentChar)){
logger.debug("Decoding lowercase");
currentChar = (char)((int)currentChar - shift);
currentChar = (char)(currentChar - shift);
//Wrap around if the letter is now out of bounds
if(currentChar < 'a'){
logger.debug("Wrapping around to z");