Movatterモバイル変換


[0]ホーム

URL:


 
» Performance Edit on GitHub

Performance

Rules that flag suboptimal code.
Table of Contents

AvoidConsoleStatements

Since: PMD 7.5.0

Priority: Medium (3)

Using the console for logging in production might negatively impact performance.In addition, logging could expose sensitive data.

This rule is defined by the following XPath expression:

//FunctionCall[PropertyGet[Name[1][@Identifier='console']][Name[2][@Identifier]]]|//FunctionCall[PropertyGet[PropertyGet[1][Name[1][@Identifier='window']][Name[2][@Identifier='console']]][Name[1][@Identifier]]]

Example(s):

varmyObj=getData();console.log(myObj);// badconsole.debug("myObj:",myObj);// bad

Use this rule by referencing it:

<ruleref="category/ecmascript/performance.xml/AvoidConsoleStatements"/>

This documentation is written in markdown.
If there is something missing or can be improved, edit this page on github and create a PR: Edit on GitHub

©2026 PMD Open Source Project. All rights reserved.
Site last generated: Jan 30, 2026

PMD                logo


[8]ページ先頭

©2009-2026 Movatter.jp