I am interested in the following fairly general question: given an affine surface defined by $f(x_1, x_2, x_3) = 0$ for some polynomial $f$ in three variables, when can one say that the surface defined will not contain a line? What if we consider the projective case when $f(x_1, x_2, x_3, x_4) = 0$ with $f$ a homogeneous polynomial in four variables?

More specifically, I am interested in the special case when $f$ (in both cases) have integer coefficients, and when $f = 0$ does not contain any lines with rational slope, or does not contain lines that contain any rational coordinates.