What: Shares of department store J.C. Penney (JCPN.Q) jumped 10.6% in August, according to S&P Capital IQ data, driven by a solid earnings report showing an improvement in comparable-store sales and margins, as well as various analyst upgrades.

So what: After suffering a severe decline in sales during the tenure of previous CEO Ron Johnson, J.C. Penney has been slowly clawing its way back. During the second quarter, the company reported a 4.1% increase in comparable-store sales, with both revenue and earnings beating analyst expectations.

Along with growing sales, J.C. Penney's gross margin continued to improve, reaching 37% during the quarter, up from 36% during the same period last year. Operating costs declined, with SG&A expenses falling by 6.5% year over year, driving a major improvement in operating profit. J.C. Penney is still unprofitable, posting a $38 million operating loss for the quarter, but this compares to a $70 million operating loss during the second quarter of 2014.

J.C. Penney expects comparable-store sales to increase by 4%-5% for the full year, with further improvements in gross margin and declines in operating expenses. The company didn't provide guidance for earnings, but it does expect free cash flow to be break even for the year.

Its results brought about a few upgrades from analysts in August. B. Riley initiated coverage with a buy rating, putting a price target of $12.50 on the stock. Deutsche Bank raised its rating to Buy, expecting J.C. Penney to improve its margins beyond the company's guidance. And Fitch Ratings raised its issuer default rating to B- from CCC, suggesting that the company is now in a stronger financial position.

Now what: J.C. Penney's earnings show that the company continues to make steady progress, winning back market share and improving profitability, and investors drove the stock higher as a result. However, it still has a long road ahead of it, and a return to profitability is complicated by about $400 million of annual interest payments.

It will take many years at the current pace of growth before J.C. Penney is able to produce a net profit. Free cash flow has reached breakeven, but only because the company is underspending on capital expenditures, a situation that can't continue indefinitely. While J.C. Penney is producing true progress in its turnaround effort, giving the stock a boost during August, long-term success is still far from guaranteed.