Conditions | 6 |
Paths | 6 |
Total Lines | 24 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
33 | public function get_postlink( $language ) { |
||
34 | if ( ! $this->has_value( $language ) ) { |
||
35 | return ''; |
||
36 | } |
||
37 | |||
38 | $post = get_post( (int) $this->__get( $language ) ); |
||
39 | if ( is_null( $post ) || 'publish' != $post->post_status ) { |
||
40 | return ''; |
||
41 | } |
||
42 | |||
43 | if ( is_null( $this->with_front ) ) { |
||
44 | $post_object = get_post_type_object( $post->post_type ); |
||
45 | $this->with_front = ! empty( $post_object->rewrite['with_front'] ); |
||
46 | } |
||
47 | |||
48 | global $current_site; |
||
49 | $blog_id = MslsBlogCollection::instance()->get_blog_id( $language ); |
||
50 | if ( $current_site->blog_id != $blog_id ) { |
||
51 | $option = get_blog_option( $blog_id, 'msls' ); |
||
|
|||
52 | //error_log( print_r( $option, true ) ); |
||
53 | } |
||
54 | |||
55 | return apply_filters( 'check_url', get_permalink( $post ), $this ); |
||
56 | } |
||
57 | |||
67 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.