Does my character's controller spin without control?

I have a character controller and, after trying to implement the movement independently of the camera, it starts spinning out of control. I have no idea why. Here is the code:

Character controller:
https://pastebin.com/5sBmhUpk

CameraController:
https://pastebin.com/4vn1BZc0