asphalt-framework/asphalt-mailer

View on GitHub

Showing 9 of 9 total issues

Function create_message has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def create_message(
Severity: Major
Found in src/asphalt/mailer/api.py - About 1 hr to fix

    Function __init__ has 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(
    Severity: Major
    Found in src/asphalt/mailer/mailers/smtp.py - About 1 hr to fix

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

      def main(
      Severity: Major
      Found in examples/simple.py - About 50 mins to fix

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

        def main(
        Severity: Major
        Found in examples/attachment.py - About 50 mins to fix

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

              def __init__(
          Severity: Major
          Found in examples/attachment.py - About 50 mins to fix

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

                def __init__(
            Severity: Major
            Found in examples/simple.py - About 50 mins to fix

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

                  def create_message(
                      self,
                      *,
                      subject: str | None = None,
                      sender: str | Address | None = None,
              Severity: Minor
              Found in src/asphalt/mailer/api.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 __init__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def __init__(
                      self,
                      *,
                      host: str = "localhost",
                      port: int | None = None,
              Severity: Minor
              Found in src/asphalt/mailer/mailers/smtp.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

              Function get_recipients has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              def get_recipients(message: EmailMessage) -> list[str]:
                  """
                  Return a list of email addresses of all the intended recipients of the given
                  message.
              
              
              Severity: Minor
              Found in src/asphalt/mailer/utils.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