Once on fire, the airline sector has struggled in July.

Specifically, Spirit Airlines Incorporated (SAVE - Get Report) and American Airlines Group Inc.  (AAL) have seen their stocks fall. AAL stock is down about 7.25% from its highs in mid-July, which actually looks good compared to SAVE stock and its 24% decline over the past month. A bulk of those losses came when Spirit reported earnings in late July, with its stock down about 20% over the past week.

None of this is stopping analysts at JPMorgan from getting on board. On Tuesday, analyst Jamie Baker upgraded both stocks to overweight from neutral.

On the the grounds of American Airlines, Baker argued that the airline has "sufficient upside potential" partly by becoming more efficient with its labor costs. As a result, he raised his price target to $61 from $52, implying a bit more than 20% upside.

Regarding Spirit Airlines, Baker actually upgraded the stock but lowered his price target significantly. Baker now expects Spirit to fly back to $45 after previously maintaining a price target of $56. Investors seem to be ignoring SAVE stock and its potential over the medium term, he reasoned. His price target implies about 15% upside from its most recent close of $38.85 on Monday.

Baker's moves come just a few days after Stifel analyst Joseph DiNardi said the decline in Spirit is an overreaction, based partly on comments from Southwest Airlines Co (LUV - Get Report) . He maintains his buy rating and $55 price target, implying about 41% upside from current levels.

Southwest Airlines is a holding in Jim Cramer's Action Alerts PLUS Charitable Trust Portfolio. Want to be alerted before Cramer buys or sells LUV? Learn more now.

Speaking of Southwest, shares are also down about 8% over the past week after investors reacted to the company's earnings results. Bernstein analyst David Vernon argued that its results were "generally positive." Although he cut his price target slightly to $69 from $70, it still implies about 25% upside. Vernon also maintains his outperform rating.

SAVE stock climbed 4% early Tuesday afternoon to $40.40, while AAL stock fell 0.1% to $50.37. LUV stock fell 0.2% to $55.40.

More of What's Trending on TheStreet:

This article is commentary by an independent contributor. At the time of publication, the author had no positions in the stocks mentioned.