graphite-project / carbon

global statement detected PYL-W0603
Anti-pattern
Major
4 years ago4 years old
Using the global statement
 74
 75
 76def recordMetrics():
 77  global lastUsage 78  global prior_stats
 79  myStats = stats.copy()
 80  myPriorStats = {}
Using the global statement
 75
 76def recordMetrics():
 77  global lastUsage
 78  global prior_stats 79  myStats = stats.copy()
 80  myPriorStats = {}
 81  stats.clear()
Using the global statement
 47
 48
 49def getCpuUsage():
 50  global lastUsage, lastUsageTime 51
 52  rusage = getrusage(RUSAGE_SELF)
 53  currentUsage = rusage.ru_utime + rusage.ru_stime
Using the global statement
220
221
222def reloadStorageSchemas():
223  global SCHEMAS224  try:
225    SCHEMAS = loadStorageSchemas()
226  except Exception as e:
Using the global statement
228
229
230def reloadAggregationSchemas():
231  global AGGREGATION_SCHEMAS232  try:
233    AGGREGATION_SCHEMAS = loadAggregationSchemas()
234  except Exception as e: