These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Godbout\Alfred\Time\Menus; |
||
4 | |||
5 | use Godbout\Alfred\Workflow\Icon; |
||
6 | use Godbout\Alfred\Workflow\Item; |
||
7 | use Godbout\Alfred\Workflow\ScriptFilter; |
||
8 | |||
9 | View Code Duplication | class Setup extends Menu |
|
0 ignored issues
–
show
|
|||
10 | { |
||
11 | public static function scriptFilter() |
||
12 | { |
||
13 | ScriptFilter::add( |
||
14 | self::toggl(), |
||
15 | self::harvest() |
||
16 | ); |
||
17 | |||
18 | ScriptFilter::sortItems(); |
||
19 | } |
||
20 | |||
21 | private static function toggl() |
||
22 | { |
||
23 | return Item::create() |
||
24 | ->title('Setup Toggl') |
||
25 | ->subtitle('') |
||
26 | ->icon(Icon::create('resources/icons/toggl.png')) |
||
27 | ->arg('toggl_setup'); |
||
28 | } |
||
29 | |||
30 | private static function harvest() |
||
31 | { |
||
32 | return Item::create() |
||
33 | ->title('Setup Harvest') |
||
34 | ->subtitle('') |
||
35 | ->icon(Icon::create('resources/icons/harvest.png')) |
||
36 | ->arg('harvest_setup'); |
||
37 | } |
||
38 | } |
||
39 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.