  Let $\mathfrak{a}$ be a proper ideal of a commutative noetherian ring $R$ and $d$ a positive integer. We answer Hartshorne's question on cofinite complexes completely in the cases $\mathrm{dim}R=d$ or $\mathrm{dim}R/\mathfrak{a}=d-1$ or $\mathrm{ara}(\mathfrak{a})=d-1$, show that if $d\leq2$ then an $R$-complex $X\in\mathrm{D}_\sqsubset(R)$ is $\mathfrak{a}$-cofinite if and only if each homology module $\mathrm{H}_i(X)$ is $\mathfrak{a}$-cofinite; if $\mathfrak{a}$ is a perfect ideal and $R$ is regular local with $d\leq2$ then an $R$-complex $X\in\mathrm{D}(R)$ is $\mathfrak{a}$-cofinite if and only if $\mathrm{H}_i(X)$ is $\mathfrak{a}$-cofinite for every $i\in\mathbb{Z}$; if $d\geq3$ then for an $R$-complex $X$ of   $\mathfrak{a}$-cofinite $R$-modules, each $\mathrm{H}_i(X)$ is $\mathfrak{a}$-cofinite if and only if $\mathrm{Ext}^j_R(R/\mathfrak{a},\mathrm{coker}d_i)$ are finitely generated for $j\leq d-2$. We also study cofiniteness of local cohomology $\mathrm{H}^i_\mathfrak{a}(X)$ for an $R$-complex $X\in\mathrm{D}_\sqsubset(R)$ in the above cases. The crucial step to achieve these is to recruit the technique of spectral sequences. 
Hartshorne's question on cofinite complexes