The markets were flat through the shortened trading week until Friday, when a helpful boost from economic data propelled the S&P 500 (^GSPC -0.62%) and Dow Jones Industrial Average (^DJI 0.52%) to respective 1.98% and 1.72% gains for the week.

Nonfarm payrolls increased by a seasonally adjusted 287,000 in June, according to the Labor Department, the strongest month since last October. That was a substantial improvement over May, which was the worst month for job creation in more than five years.

With respect to specific stocks, here's a look at some of the week's biggest movers.

Top-notch retailer

Shares of Costco (COST -0.61%) rose nearly 5% after the company announced better-than-expected same-store sales for June. Despite the actual figure not being impressive, as it was a 0% same-store sales gain, compared to the prior year, it was better than the anticipated 1.5% drop.

There's no need to adjust for a different amount of selling days in the comparable periods since both included 34 selling days for the U.S. and Canada, but if you adjust for the negative impacts on gasoline price deflation and foreign exchange, the total company's same-store sales rose 3% last month.

Further, Oppenheimer's analyst Brian Nagel noted on Friday that there is a potential catalyst for Costco investors in the near term:

COST has typically raised membership fees in the U.S. every five to six years. Given this cadence and the recent lift in annual dues in Asia, we foresee a rate hike in U.S. membership fees as early as fall 2016, potentially adding $0.15 and $0.12 to our FY17 and FY18 estimates, respectively. 

Profits!

One big mover late in the week was Barracuda Networks (NYSE: CUDA), which reported first-quarter fiscal-year 2017 results, sending its shares 17% higher. The company's revenue checked in $87 million, or 11%, higher for the quarter, compared to the year-ago period. That was $3 million higher than analysts' estimates. Meanwhile, its non-GAAP earnings-per-share checked in at $0.20, which was $0.09 higher than both analysts' estimates and its prior year's result.

Also, the company's subscribers continue to grow while its renewal rate remains high.


Graphic source: Barracuda Networks' Q1 FY 2017 presentation.

This is a step in a positive direction for investors of Barracuda Networks who have seen its stock lose roughly half of its value over the past 12 months. Time will tell if this is a temporary gain, or the beginning of a new trend -- part of the reason the company swung to a profit was because of a decline in sales and marketing spending while its subscription business improved.

When it rains, it pours

When it comes to exciting stocks, few measure up to Tesla Motors (TSLA -1.09%). But even for Tesla, when it rains, it pours -- and the past week was a storm.

Tesla's Model X. Image Source: Tesla Motors.

Early in the week, Tesla and its shareholders had a number of issues to figure out. One of which was that the electric vehicle maker missed its forecast of delivering 17,000 vehicles because of what it called an "extreme production ramp" that basically forced half of the quarter's output in the last four weeks. Tesla ended up delivering 14,370 vehicles in the second quarter -- 9,745 Model S and 4,625 Model X. The company now expects to deliver roughly 50,000 cars in the second half of the year.

Tesla was also dealing with the aftermath of a fatality in one of its electric vehicles that was reported to be in the self-driving "Autopilot" mode. That began a discussion, or perhaps better described as a war of words, between Tesla and publications such as Fortune, which essentially claimed Musk made $2 billion by selling stock on May 18 in a public offering without disclosing the May 7 crash. Tesla, among other things, said it stands by its decision to wait until the NHTSA began its investigation to disclose it to the public, and the investigation was opened on June 30.

Aside from that, a top Tesla executive, Rich Heley, vice president of product technology, was hired away by Facebook to work at its new Building 8 research lab. Heley is far from the first executive to leave Tesla, but that departure amid all of the things mentioned above as well as the pending purchase of SolarCity proves that when it rains, it pours for the electric car company.