DatabaseProcApplicationCreatedLinks
sybsystemprocssp_monitor_procstack_usage  14 déc. 14Defects Propagation Dependencies

1     
2     /*
3     ** sp_monitor_procstack_usage
4     **
5     **	Generate help/usage information in terse/verbose mode.
6     {
7     */
8     create or replace procedure sp_monitor_procstack_usage(@output_type varchar(8)
9     ) as
10        begin
11            declare @sp_command varchar(80)
12                , @msg varchar(200)
13                , @indent varchar(5)
14                , @nl_indent varchar(6) -- newline followed by indent
15    
16            print " "
17            exec sp_getmessage 18954, @msg output
18    
19            select @sp_command = @msg + " sp_monitor 'procstack' [, '<spid>'] [, '<contextblock>' ]"
20            print @sp_command
21            if (@output_type = 'terse')
22                return
23    
24            select @indent = "  -- "
25            select @nl_indent = char(10) + @indent
26    
27            print " "
28            exec sp_getmessage 19494, @msg output
29            select @sp_command = "sp_monitor 'enable', " + "'procstack'"
30            print @msg, @sp_command
31    
32            print " "
33            exec sp_getmessage 19495, @msg output
34            print @msg, @indent, @nl_indent
35            print "	sp_monitor 'procstack', '<spid>'"
36    
37            print " "
38            exec sp_getmessage 19496, @msg output
39            print @msg, @indent
40            print "	declare @spid_str	varchar(5)"
41            print "	select @spid_str = convert(varchar, @@spid)"
42            print "	exec sp_monitor 'procstack', @spid_str, '10'"
43        end
44    

DEFECTS
 MNER 3 No Error Check should check return value of exec 17
 MNER 3 No Error Check should check return value of exec 28
 MNER 3 No Error Check should check return value of exec 33
 MNER 3 No Error Check should check return value of exec 38
 MUCO 3 Useless Code Useless Brackets in create proc 8
 MUCO 3 Useless Code Useless Begin-End Pair 10
 MUCO 3 Useless Code Useless Brackets 21
 MTR1 2 Metrics: Comments Ratio Comments: 9% 8
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 3 = 2dec - 1exi + 2 8
 MTR3 2 Metrics: Query Complexity Complexity: 25 8

DEPENDENCIES
PROCS AND TABLES USED
calls proc sybsystemprocs..sp_getmessage  
   reads table master..syslanguages (1)  
   reads table sybsystemprocs..sysusermessages  
   calls proc sybsystemprocs..sp_validlang  
      reads table master..syslanguages (1)  
   reads table master..sysmessages (1)