Anale. Seria Informatică. Vol. XVI fasc. 1 – 2018 Annals. Computer Science Series. 16 th Tome 1 st Fasc. 2018 114 PERFORMANCE EVALUATION OF IMPROVED COGNITIVE COMPLEXITY METRIC AND OTHER CODE BASED COMPLEXITY METRICS Esther Isola 1 ; Stephen Olabiyisi 2 ; Elijah Omidiora 2 ; Rafiu Ganiyu 2 1 Osun State University, Osun State Nigeria, Deparment Of Information & Communication Technology 2 Ladoke Akintola University Of Technology, Oyo State Nigeria, Department Of Computer Science & Engineering Corresponding Author: Rafiu Ganiyu, raganiyu@lautech.edu.ng ABSTRACT: Complexity metric is used to estimate various parameters such as software development cost, amount of time needed for implementation and effort required in understanding the software. In this paper, different software complexity models are critically studied and compared. For application, heap sort algorithm is considered. The programs are written in three object oriented languages: C++, C# and Java. Software complexity for each program is found using the four popular Line of Code (LOC), McCabe Cyclomatic Complexity Metric, Halstead Metric and Cognitive model (Improved Cognitive Complexity Metric (ICCM)). The results are compared, according to Halstead Program Difficulty and ICCM, program in C++ has complexity higher than that of program in Java and program in Java has complexity higher than that of program in C#. KEYWORDS: Software Complexity Metric, Line of Code, Cyclomatic Number, Halstead metric, Cognitive Complexity, Heap sort algorithm. 1. INTRODUCTION The complexity of software effects on maintenance activities like software testability, reusability, understandability and modifiability. Software complexity is defined as the degree to which a system or component has a design or implementation that is difficult to understand and verify [JK14]. All the factors that make program difficult to understand are responsible for complexity. So it is necessary to find measurements for software to reduce the impacts of the complexity and guarantee the quality at the same time as much as possible. Because of that, the important challenge is how to maintain the software quality in light of the required functionalities. Various metrics of the complexity may be conducted for the software by the developers such as Halstead complexity metric [Hal76], Line of Code or Cyclomatic complexity metric [J+09]. A study was done using 71,917 C/C++ programs to find relations between internal software metrics and metrics of software dependability. It was found that there is a very strong correlation between Lines of Code and Halstead Volume; there is an even stronger correlation between Lines of Code and McCabe‟s Cyclomatic Complexity; and none of the internal software metrics makes it possible to discern correct programs from incorrect ones [Meu07]. The aim of this paper is to critically study and compare four commonly used complexity metrics: LOC complexity, McCabe Cyclomatic Complexity, Halstead and Cognitive metric. It is demonstrated through an example that these metrics provide different complexity measures for the same piece of code, thus making it difficult for the software engineer to choose a suitable complexity metric. The rest of the paper is organized as follow: section 2 presents a review of the software complexity metrics. Section 3 presents complexities of programs written in three object-oriented programming languages using various complexities metrics. A comparison of complexity metrics is presented in section 4 followed by conclusion in section 5. 2. REVIEW OF SOFTWARE COMPLEXITY METRICS Several methods have been proposed to measure the software complexity. Among the most frequently cited measures are the code based complexity metrics which are: line of code (LOC), McCabes cyclomatic complexity, Halsteads software metric and Cognitive complexity metrics like Improved Cognitive Complexity Metric (ICCM). These metrics will be discussed briefly in this section. A. Line of Code (LOC) Complexity The simplest way to measure the complexity of a program is to count the lines of executable code. There is a strong relationship and connection between complexity and size of code which influences the testability and increases the