Cov txheej txheem:

Puas yog PMD ua txhaum hauv Java?
Puas yog PMD ua txhaum hauv Java?

Video: Puas yog PMD ua txhaum hauv Java?

Video: Puas yog PMD ua txhaum hauv Java?
Video: Puas yog vim nyiaj - Mang Vang New song 2021-2022 [ Official MV ] 2024, Kaum ib hlis
Anonim

1. Txheej txheem cej luam. Cias muab, PMD yog lub hauv paus code analyzer kom pom cov programming flaws xws li tsis siv cov hloov pauv, khoob khoob khoob khoob khoob, tsim khoom tsim khoom, thiab lwm yam. Nws txhawb Java , JavaScript, Salesforce.com Apex, PLSQL, Apache Velocity, XML, XSL.

Yog li ntawd, PMD yog dab tsi?

PMD (Programming Mistake Detector) yog qhov qhib qhov chaw zoo li qub tus lej ntsuas ntsuas uas qhia txog cov teeb meem pom hauv daim ntawv thov code. Cov teeb meem qhia los ntawm PMD yog cov cai tsis muaj txiaj ntsig, lossis cov cwj pwm tsis zoo ntawm kev ua haujlwm, uas tuaj yeem txo qhov kev ua tau zoo thiab kev tswj xyuas ntawm qhov kev zov me nyuam yog tias lawv khaws cia.

Ib sab saum toj no, PMD XML yog dab tsi? Txoj cai yog ib XML configuration file, uas piav qhia txog kev sau cov cai yuav tsum tau ua hauv a PMD khiav. PMD suav nrog cov txheej txheem tsim ua kom khiav ceev kev soj ntsuam nrog lub neej ntawd teeb tsa, tab sis cov neeg siv tau txhawb kom ua lawv tus kheej cov cai los ntawm qhov pib, vim tias lawv tso cai rau kev teeb tsa ntau heev.

Tom qab ntawd, kuv yuav tshuaj xyuas kuv qhov kev ua txhaum PMD hauv dab noj hnub li cas?

khiav PMD , right-click rau ntawm qhov project node thiab xaiv " PMD โ€->โ€ Tshawb xyuas cod nrog PMD โ€.

Txhawm rau nruab PMD plugin rau dab noj hnub:

  1. Pib Eclipse thiab qhib ib qhov project.
  2. Xaiv "Help"-> "Software Updates"-> "Nrhiav thiab Nruab"
  3. Nyem "Tom ntej", tom qab ntawd nyem "Tshiab tej thaj chaw deb"
  4. Nyem rau ntawm qhov seem ntawm lub thawv dialog rau nruab lub plugin.

Koj khiav PMD li cas?

Khiav PMD ntawm kab hais kom ua

  1. Ntaus pmd [filename|jar lossis zip file uas muaj qhov chaws|directory] [cov ntaub ntawv qhia] [ruleset file], i.e:
  2. Yog tias koj siv JDK 1.3 lossis koj tsuas yog xav khiav PMD yam tsis muaj cov ntaub ntawv batch, koj tuaj yeem ua:

Pom zoo: