Showing 11 of 32 total issues
Function update_centers
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def update_centers():
effective = helpers.get_latest_date()
logger.info("Updating ARTCC information to %s NASR cycle...", effective)
data = {}
- Read upRead up
- Create a ticketCreate a ticket
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 update_airspace
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def update_airspace():
effective = helpers.get_latest_date()
logger.info("Updating airspace information to %s NASR cycle...", effective)
as_fn = helpers.download_latest_file('class_airspace_shape_files.zip')
- Read upRead up
- Create a ticketCreate a ticket
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 update_navaids
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def update_navaids():
count = 0
effective = helpers.get_latest_date()
logger.info("Updating navaid information to %s NASR cycle...", effective)
- Read upRead up
- Create a ticketCreate a ticket
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 update_towers
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def update_towers():
effective = helpers.get_latest_date()
logger.info("Updating tower information to %s NASR cycle...", effective)
defferred = []
- Read upRead up
- Create a ticketCreate a ticket
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
Avoid deeply nested control flow statements. Open
if facility_type == 'ARTCC':
facility_id = helpers.get_field(line, AFF_FIELDS['facility_id'])
facility_name = helpers.get_field(line, AFF_FIELDS['name'])
location = helpers.get_field(line, AFF_FIELDS['location'])
state = helpers.get_field(line, AFF_FIELDS['state_code'])
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if result[1]:
logger.info("Created %s-%s...", facility_id, data['name'])
else:
logger.info("Updated %s-%s...", facility_id, data['name'])
remove(twr_fn)
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if airspace_created:
logger.info("Created airspace %s", airspace)
else:
logger.info("Updated airspace %s", airspace)
AirspaceVolume.objects.filter(parent=airspace_obj).delete()
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if cur_facility != '':
# if cur_alt == 'HIGH':
cur_points.append(cur_points[0])
# poly = Polygon(cur_points).buffer(0)
# if isinstance(poly, Polygon):
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if facility_type in TYPE_FILTER:
country = helpers.get_field(line, NAV_FIELDS['country'])
if country != "": continue
code = helpers.get_field(line, NAV_FIELDS['facility_id'])
name = helpers.get_field(line, NAV_FIELDS['name'])
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if master_id is not '':
data['master'] = master_id
defferred.append(data)
continue
- Create a ticketCreate a ticket
Function gfs_url
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def gfs_url(model_run=datetime.now(tz=pytz.utc), forecast_time=datetime.now(tz=pytz.utc), resolution=GFS_1_0_DEGREE):
# Ensure times are not naive
if model_run.tzinfo is None or model_run.tzinfo.utcoffset(model_run) is None:
raise ValueError('model_run (%s) is naive!', model_run)
if forecast_time.tzinfo is None or forecast_time.tzinfo.utcoffset(forecast_time) is None:
- Read upRead up
- Create a ticketCreate a ticket
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"