Showing 11 of 22 total issues
File core.py
has 681 lines of code (exceeds 250 allowed). Consider refactoring. Open
""" Tools for managing computing environments for whole-cell modeling
* Build the Docker image
* *wc_env*: image with WC models and WC modeling tools and their dependencies
Function get_required_python_packages
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
def get_required_python_packages(self):
""" Get Python packages required for the WC models and WC modeling
tools (`config['image']['python_packages']`)
Returns:
- 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 _build_image
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def _build_image(self, image_repo, image_tags,
dockerfile_path, build_args, context_path,
pull_base_image=False):
""" Build Docker image
- 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 setup_container
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def setup_container(self, upgrade=False):
""" Install Python packages into Docker container
Args:
upgrade (:obj:`bool`, optional): if :obj:`True`, upgrade package
- 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 get_config_file_paths_to_copy_to_image
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def get_config_file_paths_to_copy_to_image(self):
""" Get list of configuration file paths to copy from ~/.wc to Docker image
Returns:
:obj:`list` of :obj:`dict`: configuration file paths to copy from ~/.wc to Docker image
- 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 build_image
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def build_image(self):
""" Build Docker image for WC modeling environment
Returns:
:obj:`docker.models.images.Image`: Docker image
- 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 run_process_in_container
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def run_process_in_container(self, cmd, work_dir=None, env=None, check=True,
Function _build_image
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _build_image(self, image_repo, image_tags,
Function push_image
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def push_image(self, image_repo, image_tags):
""" Push Docker image to DockerHub
Args:
image_repo (:obj:`str`): image repository
- 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 copy_path_to_container
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def copy_path_to_container(self, local_path, container_path, overwrite=True, container_user=WcEnvUser.root):
Function run_process_in_container
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def run_process_in_container(self, cmd, work_dir=None, env=None, check=True,
container_user=WcEnvUser.root):
""" Run a process in the current Docker container
Args:
- 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"