Showing 16 of 16 total issues
File emailee.py
has 359 lines of code (exceeds 250 allowed). Consider refactoring. Open
import enum
import mimetypes
import re
import smtplib
from email.mime.application import MIMEApplication
File emailee_async.py
has 305 lines of code (exceeds 250 allowed). Consider refactoring. Open
import multiprocessing
import threading
import time
from typing import Any, Dict, List, Union
Function send
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def send(self, outputFile: str = "") -> bool:
if self._authPassword and not self._authUsername and self._sender:
# this may happen if server methods are invoked before
# the sender method AND the person has not added an
# authUsername BUT has added an authPassword
- 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 server
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def server(
self,
smtpServer: str,
*,
port: int = 0,
- 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
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def _generate(self) -> str:
message = MIMEMultipart("mixed")
message["to"] = ", ".join(self._to) if self._to else ""
- 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 _addressCheck
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def _addressCheck(
self, emailList: List[str], type: str, ignoreErrors: bool
) -> List[str]:
self._tempEmailList = []
for email in emailList:
- 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 _sendMailFunc
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _sendMailFunc(
mailItem: Dict,
mailServer: Dict,
processQueue: multiprocessing.Queue,
outputFile: str,
Function _helperOutputFileCheck
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _helperOutputFileCheck(filename: str) -> bool:
try:
if Path(filename).is_file():
try:
fileSize: int = Path(filename).stat().st_size
- 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 server
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def server(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Consider simplifying this complex logical expression. Open
if (
self._sender
and (self._to or self._cc or self._bcc)
and self._smtpServer
and self._port
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function _sendMailFunc
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _sendMailFunc(
Function sendTo
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def sendTo(
self,
to: List[str] = [],
cc: List[str] = [],
bcc: List[str] = [],
- 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 attachmentFiles
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def attachmentFiles(self, attachmentFiles: List[str] = []) -> None:
if not isinstance(attachmentFiles, list):
raise TypeError("attachmentFiles not in list format")
for file in attachmentFiles:
- 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 ready
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def ready(self) -> bool:
if self._authPassword and not self._authUsername and self._sender:
# this may happen if server methods are invoked before
# the sender method AND the person has not added an
# authUsername BUT has added an authPassword
- 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"