"Bad code smell" or "spaghetti code" is a jargon used among programmers to refer to source code that is diffi-cult to maintain, evolve, and change. We consider them as symptoms of poor software engineering practice. This paper presents an application of concept of ontology to develop a bad code smell taxonomy. We develop a taxonomy hierarchy which categorizes bad code smells from the viewpoints of refactoring. A more formal format is introduced to define the bad code smells more concretely. Besides, the relations among bad code smells, called semantic relations in ontology terms, are explored and established. The ontology can be used for reasoning in other applications.