Codebase: Fix LGTM issues

This commit is contained in:
Mike Auty
2022-04-30 15:13:34 +01:00
parent 48c1533e89
commit 818002aba4
4 changed files with 4 additions and 11 deletions
+1 -4
View File
@@ -322,10 +322,7 @@ class PrettyTextRenderer(CLIRenderer):
tab_width = 8
while line.find('\t') >= 0:
i = line.find('\t')
if (tab_width > 0):
pad = " " * (tab_width - (i % tab_width))
else:
pad = ""
pad = " " * (tab_width - (i % tab_width))
line = line.replace("\t", pad, 1)
return line
@@ -470,14 +470,14 @@ class ModuleRequirement(interfaces.configuration.ConstructableRequirementInterfa
if req_unsatisfied:
result.update(req_unsatisfied)
if not result:
vollog.log(constants.LOGLEVEL_V, f"IndexError - No configuration provided: {config_path}")
result = {config_path: self}
return result
### NOTE: This validate method has side effects (the dependencies can change)!!!
self._validate_class(context, interfaces.configuration.parent_path(config_path))
vollog.log(constants.LOGLEVEL_V, f"IndexError - No configuration provided: {config_path}")
return {config_path: self}
return result
def construct(self, context: interfaces.context.ContextInterface, config_path: str) -> None:
"""Constructs the appropriate layer and adds it based on the class parameter."""
-3
View File
@@ -3,7 +3,6 @@
#
import functools
import json
import math
from typing import Optional, Dict, Any, Tuple, List, Set
from volatility3.framework import interfaces, exceptions, constants
@@ -131,8 +130,6 @@ class QemuSuspendLayer(segmented.NonLinearlySegmentedLayer):
index = 8
section_info = dict()
current_section_id = -1
version_id = -1
name = None
while section_byte != self.QEVM_EOF and index <= base_layer.maximum_address:
section_byte = self.context.object(self._qemu_table_name + constants.BANG + 'unsigned char',
offset = index,
@@ -1,7 +1,6 @@
from volatility3.framework import interfaces, constants
from volatility3.framework import renderers, interfaces, exceptions
from volatility3.framework.configuration import requirements
from volatility3.framework.objects import utility
from volatility3.framework.renderers import format_hints
from volatility3.framework.symbols import intermed
from volatility3.framework.symbols.windows.extensions import pe