The production of code-switching is quite common in bordering areas or in regions where two languages coexist and, according to some authors, it is even a resource to produce humour. With the aim of finding the factors of the success of humour in code-switching, I provide a pragmatic analysis on several audios from Gibraltar, Ceuta and Melilla, which contain code-switching between Spanish, English, Arabic and Berber. I will verify whether the success of humour depends on the sociolinguistic characteristics of the speaker, on the type of code-switching or on further parameters envisaged by the General Theory of Verbal Humour (GTVH). To this end, the final sections will present a comprehensive analysis of the results, divided into two categories: sociolinguistic and linguistic.