I've been able to succesfully repair a disconnecting nunchuck where the problem was a broken cable (broken inside , outside rubber tube wasn't showing any signs of damage.)
1. First you need to unscrew both the connector and the nunchuck itself to see bare cable connection with nunchuk electronic board or connector. There are 5 (or six) smaller colored cables inside the main cable.
2. Then use voltage meter to check if both ends of every colored cable are connected. Two of my nunchuck have one cable showing no reading - this is the cable you need to reconnect.
3. Now you can replace an entire cable (much hassle) or, like me, bypass the one cable that doesn't connect. I, have put the new cable on the outside , soldered to both ends it is should to connect. Then screw nunchuk and the controller.
Now, the finished thing has two cables (5-string one and single string one), I used small masking tape to tape them together every 10 or 15 cm apart. This will look bad but, hey, it works.
Other solution - buy the original replacement. I've tried Chineese knock offs (they cost $3,5 with shipping) but the joystick is so loose just after a month that is not worth it. I've found new original ones on ebay equivalent where I live going for ~$12 (in old circa 2006 packaging, but they are the same thing as those in Wii U packaging)