32 |
32 |
33 |
33 |
34 def checkFlaskDebug(reportError, context, config): |
34 def checkFlaskDebug(reportError, context, config): |
35 """ |
35 """ |
36 Function to check for a flask app being run with debug. |
36 Function to check for a flask app being run with debug. |
37 |
37 |
38 @param reportError function to be used to report errors |
38 @param reportError function to be used to report errors |
39 @type func |
39 @type func |
40 @param context security context object |
40 @param context security context object |
41 @type SecurityContext |
41 @type SecurityContext |
42 @param config dictionary with configuration data |
42 @param config dictionary with configuration data |
43 @type dict |
43 @type dict |
44 """ |
44 """ |
45 if ( |
45 if ( |
46 context.isModuleImportedLike('flask') and |
46 context.isModuleImportedLike("flask") |
47 context.callFunctionNameQual.endswith('.run') and |
47 and context.callFunctionNameQual.endswith(".run") |
48 context.checkCallArgValue('debug', 'True') |
48 and context.checkCallArgValue("debug", "True") |
49 ): |
49 ): |
50 reportError( |
50 reportError(context.node.lineno - 1, context.node.col_offset, "S201", "L", "M") |
51 context.node.lineno - 1, |
|
52 context.node.col_offset, |
|
53 "S201", |
|
54 "L", |
|
55 "M" |
|
56 ) |
|