| Conditions | 2 |
| Paths | 2 |
| Total Lines | 244 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
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:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 266 | function render_banner_b() { ?> |
||
| 267 | <div id="message" class="updated jp-wpcom-connect__container"> |
||
| 268 | <div class="jp-wpcom-connect__inner-container"> |
||
| 269 | <span |
||
| 270 | class="notice-dismiss connection-banner-dismiss" |
||
| 271 | title="<?php esc_attr_e( 'Dismiss this notice', 'jetpack' ); ?>"> |
||
| 272 | </span> |
||
| 273 | |||
| 274 | <div class="jp-wpcom-connect__vertical-nav"> |
||
| 275 | <div class="jp-wpcom-connect__vertical-nav-container"> |
||
| 276 | <div class="vertical-menu__feature-item jp-feature-intro vertical-menu__feature-item-is-selected"> |
||
| 277 | <div class="vertical-menu__feature-item-icon"> |
||
| 278 | <svg class="jp-wpcom-connect__svg-jetpack" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" version="1.1"><path d="M14.4 11.3L10.5 18.1 10.5 8.7 13.7 9.5C14.5 9.7 14.9 10.6 14.4 11.3L14.4 11.3ZM9.6 13.3L6.5 12.5C5.7 12.3 5.3 11.4 5.7 10.7L9.6 3.9 9.6 13.3ZM10 1C4.5 1 0 5.5 0 11 0 16.5 4.5 21 10 21 15.5 21 20 16.5 20 11 20 5.5 15.5 1 10 1L10 1Z" /></svg> |
||
| 279 | </div> |
||
| 280 | <span class="vertical-menu__feature-item-label"><?php esc_html_e( 'Welcome to Jetpack', 'jetpack' ); ?></span> |
||
| 281 | </div> |
||
| 282 | <div class="vertical-menu__feature-item"> |
||
| 283 | <div class="vertical-menu__feature-item-icon"> |
||
| 284 | <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 2 20 20" version="1.1"><path d="M6 4L6 10.3 9 7 13.9 12.4 14.5 11.7C15.3 10.8 16.7 10.8 17.5 11.7L18 12.2 18 4 6 4ZM20 4L20 16C20 17.1 19.1 18 18 18L6 18C4.9 18 4 17.1 4 16L4 4C4 2.9 4.9 2 6 2L18 2C19.1 2 20 2.9 20 4L20 4ZM2 20L16 20 16 20C16 21.1 15.1 22 14 22L2 22C0.9 22 0 21.1 0 20L0 8C0 6.9 0.9 6 2 6L2 6 2 20ZM13 7.5C13 6.7 13.7 6 14.5 6 15.3 6 16 6.7 16 7.5 16 8.3 15.3 9 14.5 9 13.7 9 13 8.3 13 7.5L13 7.5Z" /></svg> |
||
| 285 | </div> |
||
| 286 | <span class="vertical-menu__feature-item-label"><?php esc_html_e( 'Create Your Site', 'jetpack' ); ?></span> |
||
| 287 | </div> |
||
| 288 | <div class="vertical-menu__feature-item"> |
||
| 289 | <div class="vertical-menu__feature-item-icon"> |
||
| 290 | <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 2 20 20" version="1.1"><path d="M7.8 17.6L12.2 17.6 12.2 2 7.8 2 7.8 17.6ZM14.4 17.6L18.9 17.6 18.9 5.3 14.4 5.3 14.4 17.6ZM1.1 17.6L5.6 17.6 5.6 9.8 1.1 9.8 1.1 17.6ZM0 22L20 22 20 19.8 0 19.8 0 22Z" /></svg> |
||
| 291 | </div> |
||
| 292 | <span class="vertical-menu__feature-item-label"><?php esc_html_e( 'Make It Successful', 'jetpack' ); ?></span> |
||
| 293 | </div> |
||
| 294 | <div class="vertical-menu__feature-item"> |
||
| 295 | <div class="vertical-menu__feature-item-icon"> |
||
| 296 | <svg xmlns="http://www.w3.org/2000/svg" width="16" height="20" viewBox="0 1 16 20" version="1.1"><defs><polygon points="16 10 16 0 0 0 0 10 0 20 16 20"/></defs><g stroke="none" stroke-width="1" transform="translate(0.000000, 1.000000)"><mask fill="white"/><path d="M9 13.7L9 16 7 16 7 13.7C6.4 13.4 6 12.7 6 12 6 10.9 6.9 10 8 10 9.1 10 10 10.9 10 12 10 12.7 9.6 13.4 9 13.7L9 13.7ZM5 5C5 3.3 6.3 2 8 2 9.7 2 11 3.3 11 5L11 6 5 6 5 5ZM14 6L13 6 13 5C13 2.2 10.8 0 8 0 5.2 0 3 2.2 3 5L3 6 2 6C0.9 6 0 6.9 0 8L0 18C0 19.1 0.9 20 2 20L14 20C15.1 20 16 19.1 16 18L16 8C16 6.9 15.1 6 14 6L14 6Z" mask="url(#mask-2)"/></g></svg> |
||
| 297 | </div> |
||
| 298 | <span class="vertical-menu__feature-item-label"><?php esc_html_e( 'Keep It Safe', 'jetpack' ); ?></span> |
||
| 299 | </div> |
||
| 300 | </div> |
||
| 301 | </div> |
||
| 302 | <div class="jp-wpcom-connect__content-container"> |
||
| 303 | |||
| 304 | <!-- slide 1: intro --> |
||
| 305 | <div class="jp-wpcom-connect__slide jp-wpcom-connect__slide-one jp__slide-is-active"> |
||
| 306 | <h2><?php esc_html_e( 'Welcome to Jetpack', 'jetpack' ) ?></h2> |
||
| 307 | |||
| 308 | <div class="jp-wpcom-connect__content-icon jp-connect-illo"> |
||
| 309 | <img src="<?php echo plugins_url( 'images/jetpack-welcome.svg', JETPACK__PLUGIN_FILE ); ?>" alt="Your site is automatically protected from brute force attacks, plus you can use single sign-on for extra security." height="auto" width="250" /> |
||
| 310 | </div> |
||
| 311 | |||
| 312 | <p> |
||
| 313 | <?php |
||
| 314 | esc_html_e( |
||
| 315 | 'Jetpack is the best way to experience WordPress, whether your site is brand new or already well established.', |
||
| 316 | 'jetpack' |
||
| 317 | ); |
||
| 318 | ?> |
||
| 319 | </p> |
||
| 320 | |||
| 321 | <p> |
||
| 322 | <?php |
||
| 323 | esc_html_e( |
||
| 324 | 'You get themes and tools to design your site, marketing services to make it successful, and state-of-the-art security.', |
||
| 325 | 'jetpack' |
||
| 326 | ); |
||
| 327 | ?> |
||
| 328 | </p> |
||
| 329 | |||
| 330 | <p> |
||
| 331 | <?php |
||
| 332 | esc_html_e( |
||
| 333 | 'Connect to WordPress.com (free) to get started.', |
||
| 334 | 'jetpack' |
||
| 335 | ); |
||
| 336 | ?> |
||
| 337 | </p> |
||
| 338 | |||
| 339 | <p class="jp-banner__button-container"> |
||
| 340 | <span class="jp-banner__tos-blurb"> |
||
| 341 | <?php jetpack_render_tos_blurb(); ?> |
||
| 342 | </span> |
||
| 343 | <a |
||
| 344 | href="<?php echo esc_url( $this->build_connect_url_for_slide( '53', 1 ) ); ?>" |
||
|
|
|||
| 345 | class="dops-button is-primary"> |
||
| 346 | <?php esc_html_e( 'Set up Jetpack', 'jetpack' ); ?> |
||
| 347 | </a> |
||
| 348 | <a |
||
| 349 | href="#" |
||
| 350 | class="dops-button next-feature" |
||
| 351 | title="<?php |
||
| 352 | esc_attr_e( |
||
| 353 | 'Start tour to Learn about the benefits you receive when you connect Jetpack to WordPress.com', |
||
| 354 | 'jetpack' |
||
| 355 | ); |
||
| 356 | ?>"> |
||
| 357 | <?php esc_html_e( 'Start quick tour', 'jetpack' ); ?> |
||
| 358 | </a> |
||
| 359 | </p> |
||
| 360 | </div> <!-- end slide 1 --> |
||
| 361 | |||
| 362 | <!-- slide 2: design --> |
||
| 363 | <div class="jp-wpcom-connect__slide jp-wpcom-connect__slide-two"> |
||
| 364 | <h2><?php esc_html_e( 'Code-Free Design and Publishing', 'jetpack' ) ?></h2> |
||
| 365 | |||
| 366 | <div class="jp-wpcom-connect__content-icon jp-connect-illo"> |
||
| 367 | <img src="<?php echo plugins_url( 'images/customize-theme.svg', JETPACK__PLUGIN_FILE ); ?>" alt="Customization tools and widgets help you make your site look great without writing any code" height="auto" width="225" /> |
||
| 368 | </div> |
||
| 369 | |||
| 370 | <p> |
||
| 371 | <?php |
||
| 372 | esc_html_e( |
||
| 373 | 'Jetpack gives you access to more than 100 free and 200 premium WordPress themes.', |
||
| 374 | 'jetpack' |
||
| 375 | ); |
||
| 376 | ?> |
||
| 377 | </p> |
||
| 378 | |||
| 379 | <p> |
||
| 380 | <?php |
||
| 381 | esc_html_e( |
||
| 382 | 'Customization tools and widgets help you make your site look great without writing any code, and our CDN speeds up your images.', |
||
| 383 | 'jetpack' |
||
| 384 | ); |
||
| 385 | ?> |
||
| 386 | </p> |
||
| 387 | |||
| 388 | <p> |
||
| 389 | <?php |
||
| 390 | esc_html_e( |
||
| 391 | 'Publish with ease using WordPress.com or the official WordPress mobile apps.', |
||
| 392 | 'jetpack' |
||
| 393 | ); |
||
| 394 | ?> |
||
| 395 | </p> |
||
| 396 | |||
| 397 | <p class="jp-banner__button-container"> |
||
| 398 | <span class="jp-banner__tos-blurb"> |
||
| 399 | <?php jetpack_render_tos_blurb(); ?> |
||
| 400 | </span> |
||
| 401 | <a href="<?php echo esc_url( $this->build_connect_url_for_slide( '53', 2 ) ); ?>" class="dops-button is-primary"> |
||
| 402 | <?php esc_html_e( 'Set up Jetpack', 'jetpack' ); ?> |
||
| 403 | </a> |
||
| 404 | <a href="#" class="dops-button next-feature" title="<?php esc_attr_e( 'Jetpack Tour: Next Feature', 'jetpack' ); ?>"> |
||
| 405 | <?php esc_html_e( 'Next feature', 'jetpack' ); ?> |
||
| 406 | </a> |
||
| 407 | </p> |
||
| 408 | </div> <!-- end slide 2 --> |
||
| 409 | |||
| 410 | <!-- slide 3: marketing --> |
||
| 411 | <div class="jp-wpcom-connect__slide jp-wpcom-connect__slide-three"> |
||
| 412 | <h2><?php esc_html_e( 'Get The Traffic You Deserve', 'jetpack' ) ?></h2> |
||
| 413 | |||
| 414 | <div class="jp-wpcom-connect__content-icon jp-connect-illo"> |
||
| 415 | <img src="<?php echo plugins_url( 'images/stats-people.svg', JETPACK__PLUGIN_FILE ); ?>" alt="Get clear and concise stats and analytics about your visitors." height="auto" width="265" /> |
||
| 416 | </div> |
||
| 417 | |||
| 418 | <p> |
||
| 419 | <?php |
||
| 420 | esc_html_e( |
||
| 421 | 'A site without traffic is like a car without gas. Jetpack helps you fill up so that you can achieve your goals.', |
||
| 422 | 'jetpack' |
||
| 423 | ); |
||
| 424 | ?> |
||
| 425 | </p> |
||
| 426 | |||
| 427 | <p> |
||
| 428 | <?php |
||
| 429 | esc_html_e( |
||
| 430 | 'Kickstart your marketing with social media automation tools, related content, email subscriptions, and sharing tools.', |
||
| 431 | 'jetpack' |
||
| 432 | ); |
||
| 433 | ?> |
||
| 434 | </p> |
||
| 435 | |||
| 436 | <p> |
||
| 437 | <?php |
||
| 438 | esc_html_e( |
||
| 439 | 'You also get clear and concise stats and analytics about your visitors.', |
||
| 440 | 'jetpack' |
||
| 441 | ); |
||
| 442 | ?> |
||
| 443 | </p> |
||
| 444 | |||
| 445 | <p class="jp-banner__button-container"> |
||
| 446 | <span class="jp-banner__tos-blurb"> |
||
| 447 | <?php jetpack_render_tos_blurb(); ?> |
||
| 448 | </span> |
||
| 449 | <a |
||
| 450 | href="<?php echo esc_url( $this->build_connect_url_for_slide( '53', 3 ) ); ?>" |
||
| 451 | class="dops-button is-primary"> |
||
| 452 | <?php esc_html_e( 'Set up Jetpack', 'jetpack' ); ?> |
||
| 453 | </a> |
||
| 454 | <a href="#" class="dops-button next-feature" title="<?php esc_attr_e( 'Jetpack Tour: Next Feature', 'jetpack' ); ?>"> |
||
| 455 | <?php esc_html_e( 'Next feature', 'jetpack' ); ?> |
||
| 456 | </a> |
||
| 457 | </p> |
||
| 458 | </div> <!-- end slide 3 --> |
||
| 459 | |||
| 460 | <!-- slide 4: security --> |
||
| 461 | <div class="jp-wpcom-connect__slide jp-wpcom-connect__slide-four"> |
||
| 462 | <h2><?php esc_html_e( 'Make Sure Your Site Is Always Online', 'jetpack' ) ?></h2> |
||
| 463 | |||
| 464 | <div class="jp-wpcom-connect__content-icon jp-connect-illo"> |
||
| 465 | <img src="<?php echo plugins_url( 'images/security.svg', JETPACK__PLUGIN_FILE ); ?>" alt="Your site is automatically protected from brute force attacks, plus you can use single sign-on for extra security." height="auto" width="250" /> |
||
| 466 | </div> |
||
| 467 | |||
| 468 | <p> |
||
| 469 | <?php |
||
| 470 | esc_html_e( 'Jetpack checks your site every few minutes, and if it\'s offline we\'ll notify you instantly.', |
||
| 471 | 'jetpack' |
||
| 472 | ); |
||
| 473 | ?> |
||
| 474 | </p> |
||
| 475 | |||
| 476 | <p> |
||
| 477 | <?php |
||
| 478 | esc_html_e( 'Your site is automatically protected from brute force attacks, plus you can use single sign-on for extra security.', |
||
| 479 | 'jetpack' |
||
| 480 | ); |
||
| 481 | ?> |
||
| 482 | </p> |
||
| 483 | |||
| 484 | <?php if ( Jetpack::show_backups_ui() ): ?> |
||
| 485 | <p> |
||
| 486 | <?php |
||
| 487 | esc_html_e( 'Paying customers also benefit from automated backups, malware scans, and priority support.', |
||
| 488 | 'jetpack' |
||
| 489 | ); |
||
| 490 | ?> |
||
| 491 | </p> |
||
| 492 | <?php endif; ?> |
||
| 493 | |||
| 494 | <p class="jp-banner__button-container"> |
||
| 495 | <span class="jp-banner__tos-blurb"> |
||
| 496 | <?php jetpack_render_tos_blurb(); ?> |
||
| 497 | </span> |
||
| 498 | <a |
||
| 499 | href="<?php echo esc_url( $this->build_connect_url_for_slide( '53', 4 ) ); ?>" |
||
| 500 | class="dops-button is-primary"> |
||
| 501 | <?php esc_html_e( 'Set up Jetpack', 'jetpack' ); ?> |
||
| 502 | </a> |
||
| 503 | </p> |
||
| 504 | </div> <!-- end slide 4 --> |
||
| 505 | </div> |
||
| 506 | </div> |
||
| 507 | </div> |
||
| 508 | <?php |
||
| 509 | } |
||
| 510 | |||
| 620 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignorePhpDoc annotation to the duplicate definition and it will be ignored.