Showing 6 of 58 total issues
Function vimcryption_read
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def vimcryption_read(self):
""" General `read` function for dealing with reads in Vim using
the encryption engine to append the decrypted lines
"""
file_name = vim.eval('expand("<amatch>")')
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function generate_round_keys
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def generate_round_keys(cipher_key):
""" Generates and returns 11 round keys according to AES rules.
"""
key_matrix = bytes_to_matrix(cipher_key)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function decrypt
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def decrypt(self, file_handle, data):
# type: (io.BytesIO, Union[Iterable[str], str])
""" Block ciphers always decrypt blocks of a predefined size. By default `decrypt` will consume
`self.decrypt_blocksize` bytes and call `self.decrypt_block` on that to determine what
to append to `data`.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function decrypt
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def decrypt(self, file_handle, data):
# type: (io.BytesIO, Union[List[str], str]):
line = ""
for bchar in self.byte_iter(file_handle):
char = ""
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function vimcryption_write
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def vimcryption_write(self, vim_buffer, mode):
""" General `write` function for dealing with writes in Vim using
the encryption engine to write encrypted lines.
"""
file_name = vim.eval('expand("<amatch>")')
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function block_iter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def block_iter(generator, block_size, pad):
# type: (Iterable, int, Union[str, bytes])
""" Generative iterator that yields a [byte] string of length `block_size`
by concatenating characters yielded by `generator. The final block
is padded using `pad`.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"