While J.C. Penney's (JCPN.Q) latest earnings release showed that the troubled retailer wasn't in any immediate danger of collapse, the company is still facing serious problems that will be extremely difficult to overcome. It's easy to point to positive same-store sales growth as proof that the turnaround effort is succeeding, but cherry-picking positive numbers from a sea of negative numbers isn't a good investment strategy. Here are three charts, using peers Macy's (M 1.19%) and Kohl's (KSS 6.51%) for comparison, that sum up the issues facing J.C. Penney.

The grossest of margins
J.C. Penney's gross margin began to fall even before Ron Johnson took over in November of 2011, most of the way through fiscal 2012. Johnson brought in new brands and switched to an "everyday value" strategy, alienating customers and sending sales plummeting by nearly 25% during his first and only full year. Gross margin fell as well, and even after Johnson was replaced, the unwanted merchandise continued to drive down the this number.

Data from Morningstar for 2010-2013, and earnings reports for 2014

In fiscal 2014, the gross margin fell below 30%, about ten percentage points below its 2011 peak. Macy's has surpassed 40% in each of the past five years, and the more discount-orientated Kohl's has stayed above 35%. J.C. Penney guided for a significant improvement in the gross margin for the current year, but the next chart shows why even getting back to historical levels doesn't solve the problem.

Costs are out of control
As J.C. Penney's revenue has collapsed, the company has attempted to slash operating costs in order to compensate. But without significant store closings, there is a limit to how low costs can go before the customer experience begins to suffer. During the past two years, J.C. Penney's operating expenses have reached an unsustainable level.

Data from Morningstar for 2010-2013, and earnings reports for 2014

Back in 2010, both J.C. Penney and Macy's spent about 35% of revenue on operating expenses. The two companies began to diverge even before Ron Johnson took the helm, with Macy's becoming more efficient each and every year. By fiscal 2014, Macy's had cut operating expense to just 30.2% of revenue, down from 36% in fiscal 2010. Macy's has even started to rival the efficiency of Kohl's, closing the gap significantly over the past few years.

J.C. Penney went the other way, with lower revenue driving this number above 40%. With the gross margin lower than 30%, and the best-case scenario being that the company brings this number back up to around 40%, even if everything goes right for J.C. Penney, a loss is still essentially inevitable. Add in the nearly $400 million in annual interest payments, the result of ballooning debt, and it's clear that J.C. Penney will not be profitable any time soon.

J.C. Penney's cost structure is not sustainable given its revenue, and the company is in a race against time. It needs to grow revenue fast enough to bring its operating costs as a percentage of revenue back to historical levels, while at the same time increasing its gross margin by ten percentage points, all before the company's liquidity runs dry. 

Bankruptcy is still on the table
How much time does J.C. Penney have? Well, S&P raised the company's credit outlook to stable following the company's earnings, and this was taken as a sign that bankruptcy is no longer a possibility. But the wording of the upgrade makes it clear that J.C. Penney has bought itself a year at most, and that after that, anything goes:

The outlook revision reflects our view that performance has begun to stabilize, and we forecast further modest gains over the next year. As a result, we are revising our liquidity assessment to "adequate" from "less than adequate." However, in our view, the capital structure is unsustainable, but the company does not have any meaningful maturities over the next 12 months.

So while bankruptcy in the next year is unlikely, it becomes a real possibility again if things don't improve fast enough. One way to quantify bankruptcy risk is the Altman Z-score, which I've calculated below for J.C. Penney.

This is the version of the Altman Z-score for non-manufacturers, and any value below the red line means that the company is distressed, having a high probability of going bankrupt in the next two years. This is by no means a perfect predictor of bankruptcy, but it shows how dire J.C. Penney's situation has become. J.C. Penney's Z-score fell into the distress zone in fiscal 2013 and got worse in fiscal 2014, reflecting continued losses and growing debt. The balance sheet is in a precarious condition, and although the company likely has enough liquidity to survive this year, there are no guarantees after that.

The bottom line
Absolutely everything has to go right, and quickly, for J.C. Penney to ultimately survive. The company's cost structure and capital structure are both unsustainable, and revenue needs to grow much faster than it did during the fourth quarter. To quote Warren Buffett, "Time is the friend of the wonderful business, the enemy of the mediocre." J.C. Penney is certainly not a wonderful business, and time is running out.