Skip to content

Commit

Permalink
rename methods
Browse files Browse the repository at this point in the history
  • Loading branch information
babenek committed Nov 5, 2022
1 parent 99f3408 commit 6989e46
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions credsweeper/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,15 +348,15 @@ def data_scan(self, data_provider: DataContentProvider, depth: int, recursive_li
except Exception as gzip_exc:
logger.error(f"{data_provider.file_path}:{gzip_exc}")

elif data_provider.is_encoded():
elif data_provider.represent_as_encoded():
decoded_data_provider = DataContentProvider(data=data_provider.decoded,
file_path=data_provider.file_path,
file_type=data_provider.file_type,
info=f"{data_provider.info}|ENCODED")
new_limit = recursive_limit_size - len(decoded_data_provider.data)
candidates.extend(self.data_scan(decoded_data_provider, depth, new_limit))

elif data_provider.is_xml():
elif data_provider.represent_as_xml():
struct_data_provider = StringContentProvider(lines=data_provider.lines,
line_numbers=data_provider.line_numbers,
file_path=data_provider.file_path,
Expand Down
9 changes: 6 additions & 3 deletions credsweeper/file_handler/data_content_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,12 @@ def data(self, data: bytes) -> None:
"""data setter"""
self.__data = data

def is_xml(self) -> bool:
def represent_as_xml(self) -> bool:
"""Tries to read data as xml
Return True if reading was successful
Return:
True if reading was successful
"""
try:
xml_text = self.data.decode(encoding=DEFAULT_ENCODING).splitlines()
Expand All @@ -54,7 +57,7 @@ def is_xml(self) -> bool:
return False
return bool(self.lines and self.line_numbers)

def is_encoded(self) -> bool:
def represent_as_encoded(self) -> bool:
"""Encodes data from base64. Stores result in decoded
Return:
Expand Down

0 comments on commit 6989e46

Please sign in to comment.