Showing 11 of 12 total issues
File gerg2008.py
has 365 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# License: MIT License (https://tldrlegal.com/license/mit-license)
# Copyright (c) 2021-2022 Federico Benelli and others.
# All rights reserved.
File core.py
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# License: MIT License (https://tldrlegal.com/license/mit-license)
# Copyright (c) 2021-2022 Federico Benelli and others.
# All rights reserved.
Function calculate_properties
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def calculate_properties(
self, temperature, pressure, density, composition, ideal=False
):
"""Calculate the thermodynamic properties of the given fluid.
Function flash_pt
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def flash_pt(
fluid, pressure, temperature, iterations=50, rtol=1e-5, atol=1e-5
):
"""Vapor-Liquid PT flash.
- 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 density_iterator
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def density_iterator(
self, objective_pressure, vapor_phase=True, liquid_phase=True
):
"""With a given pressure and temperature value, get the fluid density.
- 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 __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function flash_pt
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def flash_pt(
Function calculate_properties
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def calculate_properties(
Function update_fluids
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_fluids(liquid, vapor, x, y, pressure):
Function calculate_properties
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def calculate_properties(
Function validate_ranges
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def validate_ranges(self, temperature, pressure):
"""Validate fluid temperature and pressure.
Verify whether the fluid temperature and pressure values belong to the
normal, extended or invalid use range of the GERG2008 equation of
- 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"