With a well-structured design of reusable software, it is possible to save costs in future software development cycles and generate added value. Nowadays it is difficult to quantify which grade of project structuring enhances its reusability. This is the question this paper aims to examine, based on the financial Portfolio Selection theory and Value at Risk methods that can be adapted to the field of software project structuring. Using these methods, the value of the reusable source code can be evaluated and the risks of reimplementation be compared with alternative code structures. So we can quantify and measure the effects of the software project structure on the risks of reimplementation. This model is applied to 27 Github open source software projects and enables us to investigate the influences of the project characteristics on the best possible software project granularity.