# Initial Coin Offerings and Agile Practices
## 5 Analysis of Agile ICOs Projects
### Software Development
#### Smart Contract Code Metrics  
In this section, we report the results of the analysis of the smart contracts used to implement the Agile ICOs. In particular, in order to characterize the content of these solidity files (with extension.sol), we applied a selection of code metrics. We also report the comparison between our results with the results provided by [45], related to more than 12,000 smart contracts published on the blockchain explorer Etherscan and deployed on the Ethereum blockchain until January 2018. In our analysis, we examined 502 solidity files found in Agile ICOs github projects, which could be referred directly to the ICO developers. We excluded from our analysis the files copied (or _forked_) from other projects (including templates taken from development framework like _Openzeppelin_ ([[https://openzeppelin.org/](https://openzeppelin.org/)]([https://openzeppelin.org/](https://openzeppelin.org/))). We added to the analysis the 12 smart contracts published only in Etherscan, as described before. In total, we examined 514 smart contract files. For each of them we applied the software metrics defined in Table 3, that include volume metrics and complexity metrics. In the following, we will use the term _contract_ to refer to a specific type of object of the Solidity language [44]. The declaration of an object _contract_ is similar to the declaration of a _class_ of object oriented languages. In a contract definition, it is possible declare functions and variables, that can be modified to be private, public, or internal to the contract. A solidity contract can also inherit from other contracts. We considered \"function\" the declaration, through the keyword _function_, of the executable units of code within a contract. We did not considered as functions the definition of _function modifiers_. In solidity, a modifier is a short portions of code defined through the keyword _modifier_ that can be called and incorporated in functions. They can be used to easily change the behavior of functions. Table 4 reports the summary of the statistics of the computed volume source code metrics. In the table, we also provide, for each metric, the value of the First Quartile that separates the lowest 25% of values from the highest 75%, and the Third Quartile that separates the lowest 75% of values from the highest 25%. All the reported statistics represent an overview of the distribution of metrics values. All statistical analysis were performed using R. Results show that smart contracts in Agile ICO projects have on average 65.59 lines of code. The maximum number of LOC is 808 and the minimum is 2 \begin{table}
\begin{tabular}{l c c} \hline
**Extension** & **\# Files** & **Percentage** \\ \hline js & 5015 & 35.32\% \\ png & 1043 & 7.35\% \\ sol & 786 & 5.54\% \\ cs & 680 & 4.79\% \\ md & 594 & 4.18\% \\ hpp & 533 & 3.75\% \\ json & 485 & 3.42\% \\cpp & 467 & 3.29\% \\ go & 436 & 3.07\% \\ svg & 418 & 2.94\% \\ others & 3742 & 26.35\% \\ \hline \end{tabular}
\end{table} 
Table 2: The ten most common file extensions in Agile ICO projects. For comparison, results of [45] report that the mean number of LOC is 183.8. We found that smart contracts present in Agile projects are characterized by a lower number of LOC. The mean and the median value of CPL allows us to state that examined files are well commented. As reported, there is expected about one line of comments every two lines of code. The examined solidity files declare, on average, only two contracts. This number can be considered low, in relation to the value of 9.2 reported by [45]. The maximum number of contract declarations is 66 and the minimum is 1. In total, the mean number of functions (NDF) declared in a contract is about 6.6, the maximum value is 71, and the minimum is zero. Also in this case, the mean number is lower than the results of [45] (25.9 functions per file). The mean values of NDC and NDF can be considered related to the value of the LOC metric. Solidity files are shorter and consequently less functions and contracts are declared.