******************************************************************** ****** ****** ****** LDRA Testbed (R) Quality Review Report ****** ****** ****** ****** File : /home/student/anw0044/CPE455/lab08/mode-s.c ****** ****** ****** ******************************************************************** Report Production ----------------- * C/C++ LDRA Testbed Version: 9.8.2 * Report Produced On: Tue Mar 29 2022 at 10:19:30 * Metrics Data File: /apps/ldra2019/ldra_toolsuite/metpen.dat Report Configuration -------------------- * Report Format: By Metric * Procedures Reported: All Procedures * Show Metric Passes: Yes * Show Metric Fails: Yes * Reporting Scope: Source file and associated header Analysis Phases Completed ------------------------- * Static: Yes * Complexity: Yes * Dataflow: Yes -------------------------------------------------------------------------------- Contents -------- Metrics * List of File and Procedure Metrics Procedure Table Results * Results for each Metric List of Metrics to be Displayed ------------------------------- Reformatted Code Information for File ------------------------------------- * Total reformatted Lines, Total comments in ref. Code, Executable ref. Lines, Non-executable ref. Lines Number of Procedures, Total source Lines, Expansion Factor. Procedure Information --------------------- * Executable reformatted Lines, Number of Basic Blocks, Average Length of Basic Blocks, Procedure Entry Points Procedure Exit Points. Comments Associated with Procedures (% of total) ------------------------------------------------ * Total Comments, Comments in Headers, Comments in Declarations, Comments in Executable Code Blank Lines. Ratio of Comments to Executable lines (%) ----------------------------------------- * Executable reformatted Lines, Total Comments/Exe. Lines, Header Comments/Exe. Lines, Declaration Comments/Exe. Lines Code Comments/Exe. Lines. Complexity Metrics ------------------ * Knots, Cyclomatic Complexity, Essential Knots, Essential Cyclomatic Complexity Procedure Structured (SPV). Halsteads Metrics ----------------- * Total Operators, Total Operands, Unique Operators, Unique Operands Vocabulary, Length, Volume. Loop/Interval Analysis ---------------------- * Number of Loops, Depth of Loop Nesting, Number of Order 1 Intervals, Maximum Interval Nesting Reducible (Intervals). LCSAJ and Unreachability ------------------------ * Total LCSAJs, Reachable LCSAJs, Unreachable LCSAJs, Maximum LCSAJ Density Unreachable Lines, Unreachable Branches. Dataflow Information -------------------- * Globals in Procedure, File Fan in, Fan Out. -------------------------------------------------------------------------------- ************** * * * mode-s.c * * * ************** ***************************************************** * * * Overall Results - Percentage of metrics passing * * * ***************************************************** Total Metrics: 48 Clarity Metrics: 14 (of which 4 are whole file only) Maintainability Metrics: 11 (of which 7 are whole file only) Testability Metrics: 15 (of which 7 are whole file only) =============================================================================================== PROCEDURE ALL METRICS CLARITY MAINTAINABILITY TESTABILITY =============================================================================================== mode_s_init 85 ######### 70 ######## 75 ######## 88 ######### mode_s_checksum 96 ########## 90 ########## 100 ########### 100 ########### mode_s_msg_len_by_type 74 ######## 40 ##### 100 ########### 88 ######### fix_single_bit_errors 74 ######## 70 ######## 50 ###### 75 ######## fix_two_bits_errors 74 ######## 80 ######### 25 ### 75 ######## icao_cache_has_addr 81 ######### 50 ###### 100 ########### 100 ########### add_recently_seen_icao_addr 78 ######## 40 ##### 100 ########### 100 ########### icao_addr_was_recently_seen 81 ######### 50 ###### 100 ########### 100 ########### brute_force_ap 89 ######### 90 ########## 100 ########### 88 ######### decode_ac13_field 78 ######## 70 ######## 75 ######## 88 ######### decode_ac12_field 85 ######### 70 ######## 100 ########### 88 ######### mode_s_decode 78 ######## 90 ########## 50 ###### 38 #### mode_s_compute_magnitude_vector 85 ######### 60 ####### 100 ########### 100 ########### detect_out_of_phase 81 ######### 60 ####### 100 ########### 88 ######### apply_phase_correction 96 ########## 90 ########## 100 ########### 100 ########### mode_s_detect 63 ####### 90 ########## 0 38 #### Total for mode-s.c 89 ######### 100 ########### 82 ######### 80 ######### -------------------------------------------------------------------------------- ************************************************** * * * File and Procedure Results, Metric by Metric * * * ************************************************** Reformatted Code Information for File (mode-s.c) ------------------------------------------------ ============================================================================================================================== FILE TOTAL REF. TOTAL EXECUTABLE NON-EXECUTABLE NUMBER OF TOTAL EXPANSION LINES COMMENTS REF. LINES REF. LINES PROCEDURES SRC. LINES FACTOR ============================================================================================================================== Total for mode-s.c 1407 (P) 242 (P) (17%) 918 (P) (65%) 247 (P) (18%) 16 (P) 740 (P) 1.90 (P) -------------------------------------------------------------------------------- Procedure Information (mode-s.c) -------------------------------- ================================================================================= PROCEDURE EXECUTABLE BASIC AVE. BLOCK PROCEDURE PROCEDURE LINES BLOCKS LENGTH ENTRIES EXITS ================================================================================= mode_s_init 35 (P) 11 (P) 3.18 (P) 1 (P) 1 (P) mode_s_checksum 27 (P) 10 (P) 2.70 (P) 1 (P) 1 (P) mode_s_msg_len_by_type 23 (P) 11 (P) 2.09 (P) 1 (P) 3 (F) fix_single_bit_errors 38 (P) 8 (P) 4.75 (P) 1 (P) 2 (F) fix_two_bits_errors 49 (P) 12 (P) 4.08 (P) 1 (P) 2 (F) icao_cache_has_addr 9 (P) 1 (P) 9.00 (F) 1 (P) 1 (P) add_recently_seen_icao_addr 7 (P) 1 (P) 7.00 (F) 1 (P) 1 (P) icao_addr_was_recently_seen 14 (P) 4 (P) 3.50 (P) 1 (P) 1 (P) brute_force_ap 42 (P) 13 (P) 3.23 (P) 1 (P) 2 (F) decode_ac13_field 25 (P) 8 (P) 3.12 (P) 1 (P) 2 (F) decode_ac12_field 16 (P) 6 (P) 2.67 (P) 1 (P) 3 (F) mode_s_decode 285 (F) 69 (F) 4.13 (P) 1 (P) 1 (P) mode_s_compute_magnitude_vector 28 (P) 9 (P) 3.11 (P) 1 (P) 1 (P) detect_out_of_phase 39 (P) 13 (P) 3.00 (P) 1 (P) 5 (F) apply_phase_correction 26 (P) 8 (P) 3.25 (P) 1 (P) 1 (P) mode_s_detect 255 (F) 90 (F) 2.83 (P) 1 (P) 1 (P) Total for mode-s.c 918 (P) 274 (P) 3.35 (P) 1 (P) 13 (F) -------------------------------------------------------------------------------- Comments Associated with Procedures (% of total) (mode-s.c) ----------------------------------------------------------- ====================================================================================================== PROCEDURE TOTAL IN IN IN BLANK COMMENTS HEADERS DECLARATIONS EXECUTABLE CODE COMMENTS ====================================================================================================== mode_s_init 9 (F) 1 (F) (11%) 0 (P) (0%) 8 (P) (89%) 1 (P) mode_s_checksum 20 (P) 18 (P) (90%) 0 (P) (0%) 2 (P) (10%) 5 (P) mode_s_msg_len_by_type 2 (F) 2 (F) (100%) 0 (P) (0%) 0 (F) (0%) 0 (P) fix_single_bit_errors 6 (F) 3 (F) (50%) 0 (P) (0%) 3 (P) (50%) 0 (P) fix_two_bits_errors 11 (P) 3 (F) (27%) 0 (P) (0%) 8 (P) (73%) 0 (P) icao_cache_has_addr 4 (F) 2 (F) (50%) 2 (P) (50%) 0 (F) (0%) 0 (P) add_recently_seen_icao_addr 3 (F) 3 (F) (100%) 0 (P) (0%) 0 (F) (0%) 0 (P) icao_addr_was_recently_seen 3 (F) 3 (F) (100%) 0 (P) (0%) 0 (F) (0%) 0 (P) brute_force_ap 23 (P) 15 (P) (65%) 0 (P) (0%) 8 (P) (35%) 5 (P) decode_ac13_field 7 (F) 2 (F) (29%) 0 (P) (0%) 5 (P) (71%) 0 (P) decode_ac12_field 5 (F) 2 (F) (40%) 0 (P) (0%) 3 (P) (60%) 0 (P) mode_s_decode 51 (P) 2 (F) (4%) 2 (P) (4%) 47 (P) (92%) 4 (P) mode_s_compute_magnitude_vector 3 (F) 1 (F) (33%) 2 (P) (67%) 0 (F) (0%) 0 (P) detect_out_of_phase 6 (F) 6 (P) (100%) 0 (P) (0%) 0 (F) (0%) 1 (P) apply_phase_correction 29 (P) 26 (P) (90%) 0 (P) (0%) 3 (P) (10%) 6 (P) mode_s_detect 60 (P) 3 (F) (5%) 22 (P) (37%) 35 (P) (58%) 3 (P) Total for mode-s.c 242 (P) 92 (P) (38%) 28 (P) (12%) 122 (P) (50%) 25 (P) -------------------------------------------------------------------------------- Ratio of Comments to Executable lines (%) (mode-s.c) ---------------------------------------------------- =================================================================================== PROCEDURE EXECUTABLE TOTAL IN IN IN LINES COMMENTS(%) HEADERS(%) DECL.(%) CODE(%) =================================================================================== mode_s_init 35 (P) 26 (P) 3 (P) 0 (F) 23 (P) mode_s_checksum 27 (P) 74 (P) 67 (P) 0 (F) 7 (P) mode_s_msg_len_by_type 23 (P) 9 (F) 9 (P) 0 (F) 0 (F) fix_single_bit_errors 38 (P) 16 (P) 8 (P) 0 (F) 8 (P) fix_two_bits_errors 49 (P) 22 (P) 6 (P) 0 (F) 16 (P) icao_cache_has_addr 9 (P) 44 (P) 22 (P) 22 (P) 0 (F) add_recently_seen_icao_addr 7 (P) 43 (P) 43 (P) 0 (F) 0 (F) icao_addr_was_recently_seen 14 (P) 21 (P) 21 (P) 0 (F) 0 (F) brute_force_ap 42 (P) 55 (P) 36 (P) 0 (F) 19 (P) decode_ac13_field 25 (P) 28 (P) 8 (P) 0 (F) 20 (P) decode_ac12_field 16 (P) 31 (P) 13 (P) 0 (F) 19 (P) mode_s_decode 285 (F) 18 (P) 1 (P) 1 (P) 16 (P) mode_s_compute_magnitude_vector 28 (P) 11 (P) 4 (P) 7 (P) 0 (F) detect_out_of_phase 39 (P) 15 (P) 15 (P) 0 (F) 0 (F) apply_phase_correction 26 (P) 112 (P) 100 (P) 0 (F) 12 (P) mode_s_detect 255 (F) 24 (P) 1 (P) 9 (P) 14 (P) Total for mode-s.c 918 (P) 26 (P) 10 3 (P) 13 (P) -------------------------------------------------------------------------------- Complexity Metrics (mode-s.c) ----------------------------- ====================================================================================== PROCEDURE CYCLOMATIC ESSENTIAL ESS. CYCL. STRUCTURED KNOTS COMPLEXITY KNOTS COMPLEXITY PROC (SPV) ====================================================================================== mode_s_init 8 (F) 4 (P) 0 (P) 1 (P) Yes (P) mode_s_checksum 5 (P) 4 (P) 0 (P) 1 (P) Yes (P) mode_s_msg_len_by_type 3 (P) 6 (P) 0 (P) 1 (P) Yes (P) fix_single_bit_errors 7 (F) 3 (P) 4 (F) 3 (P) No (F) fix_two_bits_errors 13 (F) 4 (P) 7 (F) 4 (F) No (F) icao_cache_has_addr 0 (P) 1 (P) 0 (P) 1 (P) Yes (P) add_recently_seen_icao_addr 0 (P) 1 (P) 0 (P) 1 (P) Yes (P) icao_addr_was_recently_seen 0 (P) 3 (P) 0 (P) 1 (P) Yes (P) brute_force_ap 2 (P) 9 (P) 2 (P) 3 (P) No (F) decode_ac13_field 4 (P) 3 (P) 3 (F) 3 (P) No (F) decode_ac12_field 3 (P) 2 (P) 0 (P) 1 (P) Yes (P) mode_s_decode 7 (F) 34 (F) 0 (P) 1 (P) Yes (P) mode_s_compute_magnitude_vector 4 (P) 4 (P) 0 (P) 1 (P) Yes (P) detect_out_of_phase 4 (P) 5 (P) 0 (P) 1 (P) Yes (P) apply_phase_correction 5 (P) 3 (P) 0 (P) 1 (P) Yes (P) mode_s_detect 36 (F) 42 (F) 13 (F) 6 (F) No (F) Total for mode-s.c 101 (F) 113 (P) 29 (P) 15 (P) No (F) -------------------------------------------------------------------------------- Halsteads Metrics (mode-s.c) ---------------------------- ============================================================================================================ FILE TOTAL TOTAL UNIQUE UNIQUE OPERATORS OPERANDS OPERATORS OPERANDS VOCABULARY LENGTH VOLUME ============================================================================================================ Total for mode-s.c 952 (F) 908 (P) 33 (P) 174 (P) 207 (P) 1860 (P) 14309 (P) -------------------------------------------------------------------------------- Loop/Interval Analysis (mode-s.c) --------------------------------- ======================================================================================= PROCEDURE NUMBER OF NESTING ORDER 1 MAX. INT. REDUCIBLE LOOPS DEPTH INTERVALS NESTING (INTERVALS) ======================================================================================= mode_s_init 2 (P) 2 (P) 4 (P) 3 (P) Yes (P) mode_s_checksum 1 (P) 1 (P) 2 (P) 2 (P) Yes (P) mode_s_msg_len_by_type 0 (P) 0 (P) 1 (P) 1 (P) Yes (P) fix_single_bit_errors 1 (P) 1 (P) 2 (P) 2 (P) Yes (P) fix_two_bits_errors 2 (P) 2 (P) 4 (P) 3 (P) Yes (P) icao_cache_has_addr 0 (P) 0 (P) 1 (P) 1 (P) Yes (P) add_recently_seen_icao_addr 0 (P) 0 (P) 1 (P) 1 (P) Yes (P) icao_addr_was_recently_seen 0 (P) 0 (P) 1 (P) 1 (P) Yes (P) brute_force_ap 0 (P) 0 (P) 1 (P) 1 (P) Yes (P) decode_ac13_field 0 (P) 0 (P) 1 (P) 1 (P) Yes (P) decode_ac12_field 0 (P) 0 (P) 1 (P) 1 (P) Yes (P) mode_s_decode 0 (P) 0 (P) 1 (P) 1 (P) Yes (P) mode_s_compute_magnitude_vector 1 (P) 1 (P) 2 (P) 2 (P) Yes (P) detect_out_of_phase 0 (P) 0 (P) 1 (P) 1 (P) Yes (P) apply_phase_correction 1 (P) 1 (P) 2 (P) 2 (P) Yes (P) mode_s_detect 4 (P) 2 (P) 6 (F) 3 (P) Yes (P) Total for mode-s.c 12 (P) 2 (P) 16 (P) 3 (P) Yes (P) -------------------------------------------------------------------------------- LCSAJ and Unreachability (mode-s.c) ----------------------------------- ================================================================================================= FILE TOTAL REACHABLE UNREACHABLE MAX. LCSAJ UNREACHABLE UNREACHABLE LCSAJS LCSAJS LCSAJS DENSITY LINES BRANCHES ================================================================================================= Total for mode-s.c 387 (P) 376 (P) 11 (F) 18 (P) 0 (P) 6 (P) -------------------------------------------------------------------------------- Dataflow Information (mode-s.c) ------------------------------- ===================================================== PROCEDURE GLOBALS IN FILE FAN PROCEDURE FAN IN OUT ===================================================== mode_s_init 0 (P) 0 (P) 3 (P) mode_s_checksum 1 (P) 4 (P) 0 (P) mode_s_msg_len_by_type 0 (P) 2 (P) 0 (P) fix_single_bit_errors 1 (P) 1 (P) 2 (P) fix_two_bits_errors 1 (P) 1 (P) 2 (P) icao_cache_has_addr 0 (P) 2 (P) 0 (P) add_recently_seen_icao_addr 0 (P) 1 (P) 2 (P) icao_addr_was_recently_seen 0 (P) 1 (P) 2 (P) brute_force_ap 1 (P) 1 (P) 3 (P) decode_ac13_field 0 (P) 1 (P) 0 (P) decode_ac12_field 0 (P) 1 (P) 0 (P) mode_s_decode 1 (P) 1 (P) 11 (F) mode_s_compute_magnitude_vector 0 (P) 0 (P) 0 (P) detect_out_of_phase 0 (P) 1 (P) 0 (P) apply_phase_correction 0 (P) 1 (P) 0 (P) mode_s_detect 1 (P) 0 (P) 7 (F) Total for mode-s.c 6 (P) 18 (P) 32 (P) -------------------------------------------------------------------------------- ****************** * * * Key to Terms * * * ****************** Clarity ------- Metrics that indicate how easy it is likely to be to read and understand the purpose of a source code module or procedure: * Executable ref. Lines * Total Comments * Comments in Headers * Comments in Declarations * Comments in Executable Code * Blank Lines * Total Comments/Exe. Lines * Declaration Comments/Exe. Lines * Code Comments/Exe. Lines * Average Length of Basic Blocks * Unique Operands * Total LCSAJs * Depth of Loop Nesting * Expansion Factor Testability ----------- Metrics that indicate the amount testing that will be required, particularly with respect to achieving high Dynamic Coverage : * Knots * Cyclomatic Complexity * Executable reformatted Lines * Number of Basic Blocks * Total Operands * Number of Loops * Procedure Exit Points * Number of Procedures * Total LCSAJs * Unreachable LCSAJs * Maximum LCSAJ Density * Unreachable Lines * Unreachable Branches * File Fan in * Fan Out Maintainability --------------- Metrics that indicate the level of consideration that must be given to modifying a source code module or procedure: * Essential Knots * Essential Cyclomatic Complexity * Knots * Cyclomatic Complexity * Vocabulary * Number of Procedures * Total LCSAJs * Unreachable LCSAJs * Maximum LCSAJ Density * Unreachable Lines * Unreachable Branches Metric results Pass/Fail indicators. ------------------------------------ The display of Pass and Fail indicators is controlled by two environment variables: ===================================================================== RESULT ENVIRONMENT FLAG INDICATOR ===================================================================== Pass SHOW_METRIC_PASS (P) Fail SHOW_METRIC_FAIL (F) Upper and lower limits for a "Total for " metric can be derived from the upper and lower limits for a procedure where appropriate. This is achieved using the 'c' marker in the Metrics Data File. The base for this calculation is currently variable between files: (Number of procedures in each source file) -------------------------------------------------------------------------------- =========================================================== * * * End of Quality Review Report * * * * Copyright (C) 2019 Liverpool Data Research Associates * * * ===========================================================