Skip to content

828: rename inspection titles #1015

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<html>
<body>
<p>[1439] Call Adobe Commerce @deprecated method: The deprecated method will be removed in upcoming versions. Consider relying on methods declared in API interfaces instead.</p>
<p>[1439] Call Magento 2 @deprecated method: The deprecated method will be removed in upcoming versions. Consider relying on methods declared in API interfaces instead.</p>
<!-- tooltip end -->
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<html>
<body>
<p>[1131] Extending from Adobe Commerce @deprecated class: The extended class will be removed in upcoming versions. Inheritance is not recommended way of extending Adobe Commerce functionality. Update code to use a class marked as @api.</p>
<p>[1131] Extending from Magento 2 @deprecated class: The extended class will be removed in upcoming versions. Inheritance is not recommended way of extending Magento Open Source|Adobe Commerce functionality. Update code to use a class marked as @api.</p>
<!-- tooltip end -->
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<html>
<body>
<p>[1338] Implemented Adobe Commerce @deprecated interface: The deprecated interface will be removed in upcoming versions. Consider removing the interface inheritance, using an interface marked as @api or an interface introduced within your implementation instead.</p>
<p>[1338] Implemented Magento 2 @deprecated interface: The deprecated interface will be removed in upcoming versions. Consider removing the interface inheritance, using an interface marked as @api or an interface introduced within your implementation instead.</p>
<!-- tooltip end -->
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<html>
<body>
<p>[1132] Importing Adobe Commerce @deprecated class: The extended class will be removed in upcoming versions. Consider using Adobe Commerce class marked as @api instead.</p>
<p>[1132] Importing Magento 2 @deprecated class: The extended class will be removed in upcoming versions. Consider using Magento Open Source|Adobe Commerce class marked as @api instead.</p>
<!-- tooltip end -->
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<html>
<body>
<p>[1332] Imported Adobe Commerce @deprecated interface: The deprecated interface will be removed in upcoming versions. Consider using an interface or class marked as @api instead.</p>
<p>[1332] Imported Magento 2 @deprecated interface: The deprecated interface will be removed in upcoming versions. Consider using an interface or class marked as @api instead.</p>
<!-- tooltip end -->
</body>
</html>
</html>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<html>
<body>
<p>[1337] Inherited from Adobe Commerce @deprecated interface: The deprecated interface will be removed in upcoming versions. Consider removing the interface inheritance, using an interface marked as @api or an interface introduced within your implementation instead.</p>
<p>[1337] Inherited from Magento 2 @deprecated interface: The deprecated interface will be removed in upcoming versions. Consider removing the interface inheritance, using an interface marked as @api or an interface introduced within your implementation instead.</p>
<!-- tooltip end -->
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<html>
<body>
<p>[1235] Overriding Adobe Commerce @deprecated constant: The deprecated constant will be removed in upcoming versions. Consider using a constant marked as @api or a private constant within your implementation instead.</p>
<p>[1235] Overriding Magento 2 @deprecated constant: The deprecated constant will be removed in upcoming versions. Consider using a constant marked as @api or a private constant within your implementation instead.</p>
<!-- tooltip end -->
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<html>
<body>
<p>[1535] Overriding Adobe Commerce @deprecated property: The deprecated property will be removed in upcoming versions. Consider relying on methods declared in API interfaces or using a private property within your implementation instead.</p>
<p>[1535] Overriding Magento 2 @deprecated property: The deprecated property will be removed in upcoming versions. Consider relying on methods declared in API interfaces or using a private property within your implementation instead.</p>
<!-- tooltip end -->
</body>
</html>
2 changes: 1 addition & 1 deletion resources/inspectionDescriptions/UsingDeprecatedClass.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<html>
<body>
<p>[1134] Using Adobe Commerce @deprecated class: The extended class will be removed in upcoming versions. Consider using Adobe Commerce class marked as @api instead.</p>
<p>[1134] Using Magento 2 @deprecated class: The extended class will be removed in upcoming versions. Consider using Magento Open Source|Adobe Commerce class marked as @api instead.</p>
<!-- tooltip end -->
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<html>
<body>
<p>[1234] Using Adobe Commerce @deprecated constant: The deprecated constant will be removed in upcoming versions. Consider using a constant marked as @api or a private constant within your implementation instead.</p>
<p>[1234] Using Magento 2 @deprecated constant: The deprecated constant will be removed in upcoming versions. Consider using a constant marked as @api or a private constant within your implementation instead.</p>
<!-- tooltip end -->
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<html>
<body>
<p>[1334] Used Adobe Commerce @deprecated interface: The deprecated interface will be removed in upcoming versions. Consider using an interface or class marked as @api instead.</p>
<p>[1334] Used Magento 2 @deprecated interface: The deprecated interface will be removed in upcoming versions. Consider using an interface or class marked as @api instead.</p>
<!-- tooltip end -->
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<html>
<body>
<p>[1534] Using Adobe Commerce @deprecated property: The deprecated method will be removed in upcoming versions. Consider relying on methods declared in API interfaces instead.</p>
<p>[1534] Using Magento 2 @deprecated property: The deprecated method will be removed in upcoming versions. Consider relying on methods declared in API interfaces instead.</p>
<!-- tooltip end -->
</body>
</html>
44 changes: 22 additions & 22 deletions resources/uct/bundle/inspection.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,28 @@ inspection.displayName.InheritedDeprecatedInterface=Inherited from @deprecated i
inspection.displayName.ImplementedDeprecatedInterface=Implemented @deprecated interface
inspection.displayName.CallingDeprecatedMethod=Call @deprecated method
inspection.displayName.UsingDeprecatedProperty=Using @deprecated property
inspection.displayName.ImportingNonExistentClass=Importing non-existent Adobe Commerce class
inspection.displayName.ImportingNonExistentInterface=Importing non-existent Adobe Commerce interface
inspection.displayName.InheritedNonExistentInterface=Inherited non-existent Adobe Commerce interface
inspection.displayName.ImplementedNonExistentInterface=Implemented non-existent Adobe Commerce interface
inspection.displayName.ExtendedNonExistentClass=Extended non-existent Adobe Commerce class
inspection.displayName.OverriddenNonExistentConstant=Overridden non-existent Adobe Commerce constant
inspection.displayName.OverriddenNonExistentProperty=Overridden non-existent Adobe Commerce property
inspection.displayName.CalledNonExistentMethod=Call non-existent Adobe Commerce method
inspection.displayName.UsedNonExistentType=Used non-existent Adobe Commerce type
inspection.displayName.UsedNonExistentConstant=Used non-existent Adobe Commerce constant
inspection.displayName.UsedNonExistentProperty=Used non-existent Adobe Commerce property
inspection.displayName.ImportedNonApiClass=Imported non Adobe Commerce API class
inspection.displayName.ImportedNonApiInterface=Imported non Adobe Commerce API interface
inspection.displayName.CalledNonApiMethod=Called non Adobe Commerce API method
inspection.displayName.OverriddenNonApiConstant=Overridden non Adobe Commerce API constant
inspection.displayName.OverriddenNonApiProperty=Overridden non Adobe Commerce API property
inspection.displayName.UsedNonApiConstant=Used non Adobe Commerce API constant
inspection.displayName.UsedNonApiProperty=Used non Adobe Commerce API property
inspection.displayName.UsedNonApiType=Used non Adobe Commerce API type
inspection.displayName.ImplementedNonApiInterface=Implemented non Adobe Commerce API interface
inspection.displayName.ExtendedNonApiClass=Extended non Adobe Commerce API class
inspection.displayName.InheritedNonApiInterface=Inherited non Adobe Commerce API interface
inspection.displayName.ImportingNonExistentClass=Importing non-existent Magento 2 class
inspection.displayName.ImportingNonExistentInterface=Importing non-existent Magento 2 interface
inspection.displayName.InheritedNonExistentInterface=Inherited non-existent Magento 2 interface
inspection.displayName.ImplementedNonExistentInterface=Implemented non-existent Magento 2 interface
inspection.displayName.ExtendedNonExistentClass=Extended non-existent Magento 2 class
inspection.displayName.OverriddenNonExistentConstant=Overridden non-existent Magento 2 constant
inspection.displayName.OverriddenNonExistentProperty=Overridden non-existent Magento 2 property
inspection.displayName.CalledNonExistentMethod=Call non-existent Magento 2 method
inspection.displayName.UsedNonExistentType=Used non-existent Magento 2 type
inspection.displayName.UsedNonExistentConstant=Used non-existent Magento 2 constant
inspection.displayName.UsedNonExistentProperty=Used non-existent Magento 2 property
inspection.displayName.ImportedNonApiClass=Imported non Magento 2 API class
inspection.displayName.ImportedNonApiInterface=Imported non Magento 2 API interface
inspection.displayName.CalledNonApiMethod=Called non Magento 2 API method
inspection.displayName.OverriddenNonApiConstant=Overridden non Magento 2 API constant
inspection.displayName.OverriddenNonApiProperty=Overridden non Magento 2 API property
inspection.displayName.UsedNonApiConstant=Used non Magento 2 API constant
inspection.displayName.UsedNonApiProperty=Used non Magento 2 API property
inspection.displayName.UsedNonApiType=Used non Magento 2 API type
inspection.displayName.ImplementedNonApiInterface=Implemented non Magento 2 API interface
inspection.displayName.ExtendedNonApiClass=Extended non Magento 2 API class
inspection.displayName.InheritedNonApiInterface=Inherited non Magento 2 API interface
inspection.displayName.PossibleDependencyOnImplDetails=Possible dependency on implementation details
inspection.displayName.CalledNonInterfaceMethod=Called non-interface method
customCode.warnings.deprecated.1131=[1131] Extended class ''{0}'' that is @deprecated in the ''{1}''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiDirectory;
import com.intellij.psi.PsiDocumentManager;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiManager;
import com.jetbrains.php.lang.psi.PhpFile;
import com.magento.idea.magento2plugin.util.magento.MagentoVersionUtil;
import com.magento.idea.magento2uct.execution.output.ReportBuilder;
import com.magento.idea.magento2uct.execution.output.Summary;
import com.magento.idea.magento2uct.execution.output.UctReportOutputUtil;
Expand All @@ -42,6 +44,8 @@
@SuppressWarnings({"PMD.NPathComplexity", "PMD.ExcessiveImports", "PMD.CognitiveComplexity"})
public class GenerateUctReportCommand {

private static final String DEFAULT_MAGENTO_EDITION_LABEL = "Magento Open Source";

private final Project project;
private final OutputWrapper output;
private final ProcessHandler process;
Expand Down Expand Up @@ -99,6 +103,13 @@ public void execute() {
);
final ReportBuilder reportBuilder = new ReportBuilder(project);
final UctReportOutputUtil outputUtil = new UctReportOutputUtil(output);
final Pair<String, String> version = MagentoVersionUtil.getVersionData(
project,
project.getBasePath()
);
final String resolvedEdition = version.getSecond() == null
? DEFAULT_MAGENTO_EDITION_LABEL
: version.getSecond();

ApplicationManager.getApplication().executeOnPooledThread(() -> {
ApplicationManager.getApplication().runReadAction(() -> {
Expand Down Expand Up @@ -154,7 +165,7 @@ public void execute() {
}
summary.trackProcessFinished();
summary.setProcessedModules(scanner.getModuleCount());
outputUtil.printSummary(summary);
outputUtil.printSummary(summary, resolvedEdition);

if (summary.getProcessedModules() == 0) {
process.destroyProcess();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,10 @@ public void printIssue(final @NotNull ProblemDescriptor descriptor, final int co
* Print summary information.
*
* @param summary Summary
* @param platformName String
*/
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
public void printSummary(final Summary summary) {
public void printSummary(final Summary summary, final String platformName) {
if (summary.getProcessedModules() == 0) {
stdout.print(stdout.wrapInfo("Couldn't find modules to analyse").concat("\n"));
return;
Expand All @@ -92,7 +93,7 @@ public void printSummary(final Summary summary) {

final Map<String, String> summaryMap = new LinkedHashMap<>();
summaryMap.put("Installed version", summary.getInstalledVersion());
summaryMap.put("Adobe Commerce version", summary.getTargetVersion());
summaryMap.put(platformName + " version", summary.getTargetVersion());
summaryMap.put("Running time", summary.getProcessRunningTime());
summaryMap.put("Checked modules", String.valueOf(summary.getProcessedModules()));
summaryMap.put("Total warnings found", String.valueOf(summary.getPhpWarnings()));
Expand Down