A police force has been told to improve how it investigated crime after a watchdog found it does not have enough detectives.