San Francisco and San Jose topped the list while two other California cities sank to the bottom.