plugins/Weather/__init__.py
File __init__.py
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# -*- coding: utf-8 -*-
#
# plugins/Weather/__init__.py
#
# Copyright (C) 2009 Peter
Function Configure
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
def Configure(self, parameter_name1="", parameter_name2="", parameter_name3=0):
text=self.text
dialog = eg.ConfigPanel(self)
- 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 Configure
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def Configure(self, parameter_name1="", parameter_name2="", parameter_name3=0):
text=self.text
dialog = eg.ConfigPanel(self)
Function Configure
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def Configure(self, location_id = "Antwerp, Belgium", hl=''):
text=self.text
dialog = eg.ConfigPanel(self)
Function __call__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def __call__(self, parameter_name1, parameter_name2, parameter_name3):
if self.plugin.weather_data is None:
return None
elif parameter_name1 == "" and parameter_name2 == "":
return self.plugin.weather_data
- 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
Avoid too many return
statements within this function. Open
Open
return self.plugin.weather_data[parameter_name1][parameter_name2]