netinvent/cryptidy

View on GitHub

Showing 8 of 21 total issues

Function aes_decrypt_message has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def aes_decrypt_message(msg, aes_key):
    # type: (bytes, bytes) -> Tuple[datetime, Any]
    """
    AES decrypt a python object / bytes / string and check the encryption timestamp

Severity: Minor
Found in cryptidy/symmetric_encryption.py - About 1 hr to fix

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 remove_hf has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

def remove_hf(
Severity: Major
Found in cryptidy/hf_handling.py - About 50 mins to fix

    Function add_hf has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def add_hf(
    Severity: Major
    Found in cryptidy/hf_handling.py - About 50 mins to fix

      Function aes_decrypt has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      def aes_decrypt(aes_key, nonce, tag, ciphertext):
          # type: (bytes, bytes, bytes, bytes) -> bytes
          """
          Decrypt a bytes message
      
      
      Severity: Minor
      Found in cryptidy/aes_encryption.py - About 45 mins to fix

      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 aes_encrypt has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      def aes_encrypt(msg, aes_key):
          # type: (bytes, bytes) -> Tuple[Union[bytes, bytearray, memoryview], bytes, bytes]
          """
          Encrypt a bytes message
      
      
      Severity: Minor
      Found in cryptidy/aes_encryption.py - About 45 mins to fix

      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 rsa_decrypt_message has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      def rsa_decrypt_message(msg, private_key):
          # type: (bytes, str) -> Tuple[datetime, Any]
          """
          RSA decrypt a python object / bytes / string and check the encryption timestamp
      
      
      Severity: Minor
      Found in cryptidy/asymmetric_encryption.py - About 35 mins to fix

      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 rsa_encrypt_message has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      def rsa_encrypt_message(msg, public_key):
          # type: (Any, str) -> bytes
          """
          RSA encrypt a python object / bytes / string and add an encryption timestamp
      
      
      Severity: Minor
      Found in cryptidy/asymmetric_encryption.py - About 35 mins to fix

      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 aes_encrypt_message has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      def aes_encrypt_message(msg, aes_key):
          # type: (Any, bytes) -> bytes
          """
          AES encrypt a python object / bytes / string and add an encryption timestamp
      
      
      Severity: Minor
      Found in cryptidy/symmetric_encryption.py - About 25 mins to fix

      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

      Severity
      Category
      Status
      Source
      Language