Mapping   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 74
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 74
rs 10
c 1
b 0
f 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A mapCity() 0 7 1
B mapDetail() 0 26 1
A mapDay() 0 7 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: ignatenkov
5
 * Date: 23.08.15
6
 * Time: 5:32
7
 */
8
9
namespace YaWeather;
10
11
12
class Mapping {
13
14
    public static function mapCity() {
15
        return array(
16
            "city" => "city",
17
            "country" => "country",
18
            "region" => "region"
19
        );
20
    }
21
22
    public static function mapDetail() {
23
        return array(
24
            "temperature_from" => "temperature_from",
25
            "temperature_to" => "temperature_to",
26
            "inner" => [
27
                "temperature-data" => "temperature_avg",
28
            ],
29
            "station" => "station",
30
            "observation_time" => "observation_time",
31
            "uptime" => "uptime",
32
            "temperature" => "temperature",
33
            "weather_condition" => "weather_condition",
34
            "image" => "image",
35
            "image-v2" => "image_v2",
36
            "image-v3" => "image_v3",
37
            "weather_type" => "weather_type",
38
            "wind_direction" => "wind_direction",
39
            "wind_speed" => "wind_speed",
40
            "humidity" => "humidity",
41
            "pressure" => "pressure",
42
            "mslp_pressure" => "mslp_pressure",
43
            "daytime" => "daytime",
44
            "season" => "season",
45
            "ipad_image" => "ipad_image"
46
        );
47
    }
48
49
    public static function mapDay() {
50
        return array(
51
            "sunrise" => "sunrise",
52
            "sunset" => "sunset",
53
            "moon_phase" => "moon_phase"
54
        );
55
    }
56
57
    /*public static function map() {
0 ignored issues
show
Unused Code Comprehensibility introduced by
54% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
58
        return [
59
            "forecast" => [
60
                "name" => "City",
61
                "attributes" => [
62
                    "city" => "city",
63
                    "country" => "country"
64
                ],
65
                "fact" => [
66
                    "name" => "fact",
67
                    "station" => [
68
                        "name" => "station",
69
                        "attributes" => [
70
                            "lang" => "lang"
71
                        ]
72
                    ],
73
                    "uptime" => "uptime",
74
                    "image" => [
75
                        "name" => "image",
76
                        "attributes" => [
77
                            "type" => "type"
78
                        ]
79
                    ]
80
                ]
81
            ]
82
        ];
83
    }*/
84
85
}