From 16037e40a1ef4817f7531c9991153ad503e01471 Mon Sep 17 00:00:00 2001 From: Stefan Vacareanu Date: Thu, 20 Jun 2024 10:44:05 +0300 Subject: [PATCH] Update tests #2 --- docs/codacy-rules.yaml | 6 +++--- .../src/test_find_all_passwords_and_empty_string.pls | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/codacy-rules.yaml b/docs/codacy-rules.yaml index fe4b1fb..fd98de4 100644 --- a/docs/codacy-rules.yaml +++ b/docs/codacy-rules.yaml @@ -3,7 +3,7 @@ rules: severity: ERROR languages: - csharp - pattern: var $PASSWORD = "$VALUE"; + pattern: var $PASSWORD = "$VALUE" regex: "(?i).*(password|motdepasse|heslo|adgangskode|wachtwoord|salasana|passwort|passord|senha|geslo|clave|losenord|clave|parola|secret|pwd).*" message: Hardcoded passwords are a security risk. They can be easily found by attackers and used to gain unauthorized access to the system. metadata: @@ -18,7 +18,7 @@ rules: severity: WARNING languages: - generic - pattern: var $STRING = ''; + pattern: var $STRING = '' message: Empty strings can lead to unexpected behavior and should be handled carefully. metadata: description: Detects empty strings in the code which might cause issues or bugs. @@ -29,7 +29,7 @@ rules: languages: - generic pattern: | - var $PASSWORD = $...VALUE; + var $PASSWORD = $...VALUE options: generic_ellipsis_max_span: 0 message: > diff --git a/docs/multiple-tests/codacy-rules/src/test_find_all_passwords_and_empty_string.pls b/docs/multiple-tests/codacy-rules/src/test_find_all_passwords_and_empty_string.pls index 3ca16a6..7df42d6 100644 --- a/docs/multiple-tests/codacy-rules/src/test_find_all_passwords_and_empty_string.pls +++ b/docs/multiple-tests/codacy-rules/src/test_find_all_passwords_and_empty_string.pls @@ -4,7 +4,7 @@ CREATE OR REPLACE PACKAGE find_passwords AS -- Declaration of passwords password1 VARCHAR2(100) := 'Password123!'; - password2 VARCHAR2(100) := 'Admin@456'; + password2 VARCHAR2(100) = 'Admin@456'; password3 VARCHAR2(100) := 'UserPass789'; -- Procedure to output passwords @@ -26,7 +26,7 @@ END find_passwords; -- Example 2: Using empty strings CREATE OR REPLACE PACKAGE find_empty_string AS -- Declaration of empty strings - empty_string1 VARCHAR2(100) := ''; + empty_string1 VARCHAR2(100) = ''; empty_string2 VARCHAR2(100); -- Procedure to output empty strings