Passed
Push — v1 ( cb608b...95405e )
by Andrew
07:32 queued 03:24
created

Commerce::getProductDataFromProduct()   D

Complexity

Conditions 22
Paths 199

Size

Total Lines 89
Code Lines 60

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 89
rs 4.3966
c 0
b 0
f 0
cc 22
eloc 60
nc 199
nop 1

How to fix   Long Method    Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
/**
3
 * Instant Analytics plugin for Craft CMS 3.x
4
 *
5
 * Instant Analytics brings full Google Analytics support to your Twig templates
6
 *
7
 * @link      https://nystudio107.com
8
 * @copyright Copyright (c) 2017 nystudio107
9
 */
10
11
namespace nystudio107\instantanalytics\services;
12
13
use nystudio107\instantanalytics\InstantAnalytics;
14
15
use Craft;
16
use craft\base\Component;
17
18
/**
19
 * Commerce Service
20
 *
21
 * @author    nystudio107
22
 * @package   InstantAnalytics
23
 * @since     1.0.0
24
 */
25
class Commerce extends Component
26
{
27
    // Public Methods
28
    // =========================================================================
29
30
    // TODO: pending Commerce for Craft 3
31
}
32