Skip to content

Commit 666c41a

Browse files
Refactor logging messages and remove redundant debug statements
1 parent 2c4735f commit 666c41a

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
"jetmartin.bats",
1313
"ms-azuretools.vscode-containers",
1414
"github.vscode-github-actions",
15-
"ms-vscode.makefile-tools",
1615
"ms-vscode-remote.remote-containers",
1716
"DEVSENSE.phptools-vscode",
18-
"redhat.vscode-yaml"
17+
"redhat.vscode-yaml",
18+
"timonwong.shellcheck"
1919
]
2020
}
2121
},

lib/Command/TagUnscannedCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ protected function configure(): void {
4242
#[\Override]
4343
protected function execute(InputInterface $input, OutputInterface $output): int {
4444
$logger = new ConsoleCommandLogger($this->logger, $output);
45-
$logger->info('taggings files as unscanned');
45+
$logger->info('tagging files as unscanned');
4646
$start = microtime(true);
4747
$taggedFilesCount = $this->tagUnscannedService
4848
->withLogger($logger)

lib/Service/VerdictService.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,6 @@ public function __construct(
8080
public function scanFileById(int $fileId): VaasVerdict {
8181
$node = $this->fileService->getNodeFromFileId($fileId);
8282
$filePath = $node->getStorage()->getLocalFile($node->getInternalPath());
83-
if (file_exists($filePath) === false) {
84-
$this->logger->debug('Could not Scan File. File does not exist: ' . $filePath);
85-
}
86-
if (is_dir($filePath)) {
87-
$this->logger->debug('Could not Scan File. File is a directory: ' . $filePath);
88-
}
8983
if (self::isFileTooLargeToScan($filePath)) {
9084
$this->tagService->setTag($fileId, TagService::WONT_SCAN, silent: true);
9185
throw new EntityTooLargeException('File is too large');
@@ -127,7 +121,6 @@ public function isFileTooLargeToScan(string $path): bool {
127121
*/
128122
public function isAllowedToScan(string $filePath): bool {
129123
$doNotScanThis = $this->getDoNotScanThis();
130-
$this->logger->debug('doNotScanThis: ' . implode(', ', $doNotScanThis));
131124
foreach ($doNotScanThis as $doNotScanThisItem) {
132125
if (str_contains(strtolower($filePath), strtolower($doNotScanThisItem))) {
133126
return false;
@@ -137,7 +130,6 @@ public function isAllowedToScan(string $filePath): bool {
137130
if (count($scanOnlyThis) === 0) {
138131
return true;
139132
}
140-
$this->logger->debug('scanOnlyThis: ' . implode(', ', $scanOnlyThis));
141133
foreach ($scanOnlyThis as $scanOnlyThisItem) {
142134
if (str_contains(strtolower($filePath), strtolower($scanOnlyThisItem))) {
143135
return true;

0 commit comments

Comments
 (0)