In software engineering the determination of software size is a central issue. There have been numerous publications about software size estimation methods. Although some of these methods provide very good results in specific areas, there is no method that is both abstract enough to be used on different areas and at the same time addresses complexity in an adequate way.This work presents a new approach for analyzing software code quantity by using states. Thereby states provide an abstract variable to measure complexity and a mathematical model calculates complexity. The mathematical model is based on Shannon's information entropy. This method has successfully been applied in the field of hardware engineering. We will now show, how this abstract method can also be used to calculate the size of software. With states it is possible to calculate complexity of software which we call entropy. A system's disorder is a property of a system's state. Therefore complexity is a measurement for a system's disorder. By changing the amount of possible states of a system, complexity varies.