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