It is narrated from Sayyiduna Mu'adh bin Anas al-Juhani (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) used to say: "The one who laughs in prayer, the one who looks around, and the one who cracks his fingers - they are all of one rank."
Hadith Referenceالمعجم الكبير للطبراني / باب الميم / 17554