PMD issue and Java --version - salesforce

I would like to know if this message is correct, when I write in cmd
java --version
I add it in the path
I have some troubles with Salesforce extension PMD and shows the following message :

Yeah, I also faced these warnings.
I created a starter project (java-17, maven, pmd, unit tests, log4j2).
https://github.com/yan-khonski-it/java-17-pmd
Instead of using a specific rule, I used category.
<rulesets>
<ruleset>category/java/bestpractices.xml</ruleset>
<!-- My own file with custom rules, you can remove it-->
<ruleset>custom-ruleset.xml</ruleset>
</rulesets>
For example, in the plugin source code:
<!-- Rules, that have been moved into a category -->
and same applies to other categories / rule sets.
https://github.com/pmd/pmd/blob/master/pmd-java/src/main/resources/rulesets/java/junit.xml

Related

New Module connected with a Host App but Route to the module pages gives me a 404 error

I'm trying to get started with module development using Abp framework, the potential of using the framework is huge with the community and the abp.commercial support if it's needed, but it's not always easy to up and running the application. Let me explain...
I have created a new module: abp new sample.module -t module. ABP CLI version 3.3.1
After that, I have added a new entity in Domain (member.cs) and using AbpHelper.GUI to auto-generate all the code.
🎉My module works correctly using Hosts/*.web.unified test project. Well done! :).🎉
NOTE: see here if you want to know how to solve a tricky issue for me at this point.
Next, I have added assemblies one by one to the Host App. I have mapped:
Module.Application --> Host.Application
Module.Application.Contracts --> Host.Application.Contracts
Module.Domain --> Host.Domain
Module.Domain.Shared --> Host.Domain.Shared
Module.EntityFrameworkCore --> Host.EntityFrameworkCore
Module.HttpApi --> Host.HttpApi
Module.HttpApi.Client --> Host.HttpApi.Client
Module.Web --> Host.Web
Finally, I added Module Dependencies and Configurations, following this post.
🎉 Restore, build, dotnet ef migrations, and *.HostApp.DbMigrator work like a charm and the database is updated based on the entities in the module. Cool! 🎉
But... when I run my Host App and click on the new module menu contributor the route doesn't work 😒 but it seems to be correct based on the page structure of the module and it worked fine using Hosts/*.web.unified test project inside the module.
I tried several times with no lucky 🤦‍♂️
Something is missing in the code that I cannot see.
Any help is really appreciated.
Because the Host application and Module are in different solutions. I was missing to include an assembly (Module.Web.Views.dll) into the Host web project.

Can I use sencha cmd as to minify/compress?

We have an ExtJS modern app. We would like to use cmd to minimize/compress our code into a single .js file - effectively doing what a non Ext app would do with other minifiers like uglifyjs or terser.
I believed we could achieve this with the compile command such as:
sencha -sdk ext-7.1.0.46 compile -cl=myclassfolder -inp=ES6 concat outfile.js
However, it complains that it can't find the Ext classes with an error like:
[ERR] Failed to resolve dependency Ext.data.Model for file myapp.model.mymodel
[ERR] Unknown definition for dependency : Ext.data.Model
It seems to be the basic task of extending Ext.data.Model it doesn't like and very much feels like I simply need to reference the extJS class structure correctly for this to work, but can't figure out the command line to make it happen (I somewhat assumed that the sdk reference would fix this).
Is this possible?
Ok, to help anyone who is facing the same problem and wants to compress/minify their ExtJS but without creating a full sencha app.
The command is fairly simple and the answer is to include the path to your dependent js files in the -cl (or -classpath) argument, then exlude the Ext namespace:
sencha -sdk stack/Sencha/ext-7.2.0 compile -cl=ext-modern-all.js,packages/ux/modern/ux.js,myclassfolder -inp=ES6 exclude -namespace Ext and concat outfile.js
You can then use terser or your preferred minify tools to minify/mangle the output (or add the compress command to the above to allow cmd to minify also). It's a reasonable way to build your ExtJS code into several manageable extjs "modules" which can be loaded when needed (or when security allows) rather than the "big bang" approach of cmd.
This will produce a single js file, correctly ordered, the only issue is that it includes the Ext microloader code, which it adds by default. I have not managed to have the compiler not inlcude the microloader, however you can effectively disable it by defining the microloader yourself between the load of your ext-all.js file and your newly created file by using something like this is another file or inline script tag:
Ext.Microloader = {
run: function(){}
};
I know there aren't many folks left using ExtJS, hope this helps someone at some point, at worst case it allows a bit more control of the ExtJS build process.

Unable to Obfuscate Hybrid code using Proguard in MFP 7.1

I am developing ionic application using mfp 7.1. I have to obfuscate theapplication, for that I have refer the following link,
https://www.ibm.com/support/knowledgecenter/SSHS8R_7.1.0/com.ibm.worklight.deploy.doc/admin/t_pg_creating_obfus_cli.html
Using the above link I have done with the following steps:
1) In the project.properties file uncommented the line
proguard.config=proguard-project.txt.
2) Created keystore file and its added in the "ant.properties" file.
3) finally, we build the application.
We unable to get the "mapping.txt" file in the project
& also not able to get obfuscate code.*
Can any one tell me how to obfuscate it??
Anyone help will be Appreciated!!!
Proguard obfuscation will work on native code. You mention an Ionic application. As such you should try Javascript obfuscators for your application:
Google Closure
Compiler YUI Compressor
UgifyJS
More details here.
Within MFP, the options available are to perform JS and CSS concatenation and minification. The other options are outside of MFP and needs to be done using the respective tools.

Compile custom version of extjs

Maybe someone can help me with my requirement.
I am in trouble about the compilation of a new custom version of extjs with the use of sencha CMD.
For this purpose, I have used diffetent instructions but with the same result. No one instructions seems to work properly or perhaps there is something wrog in these instruction.
Below, the latest instruction that I have used for produce a custom version for extjs.
sencha -debug=false compile -classpath="ext-6.0.1\classic\classic\src,ext-6.0.1\packages\core\src,ext-6.0.1\classic\classic\overrides" exclude -namespace Ext.chart and concat -yui -out "test.js"
After the execution of this instruction, in test.js I have a custom version of Extjs. Or so it seems.
If I include this js into a webpage, with Firefox and firebug I can see this error of javascript: "Ext is undefined".
From this, I have some questions:
First of all, is this the correct way to compile a new custom version?
The classpath parameter is correct? There are other paths to include?
In the instruction above, I have included the "exclude" parameter (for the namespace Ext.chart) but if I search in the output file I can found the related functions. It is the correct way to exclude something? Ext.chart is the namespace or is the class name?
Thanks in advance for any reply.
Lorenzo.

Sencha Cmd v3 build error when implementing Bryntum Scheduler

Using Cmd 3.0.0.141, I have successfully generated a workspace and an Ext app in that workspace. The application builds correctly until I attempt to integrate the Bryntum Scheduler, where I encounter an error when I try to build:
"Failed to resolve dependency Sch.panel.SchedulerTree for file ExtCalendar.view.Tree"
the app is very simple at this point, uses Ext.application and follows the MVC pattern where I have a view defined "ExtCalendar.view.Tree" that extends 'Sch.panel.SchedulerTree". I also have models and stores that extend Bryntum classes as well, so I assume the compiler will trip over those as well, since it can't see the Sch namespace.
I've added a 'js' path to my app.json that points to the bryntum js file where 'Sch.panel.SchedulerTree' comes from. I've tried to run the 'refresh' command with the same results (Failed to resolve...). I've regenerated the bootstrap.js file manually using 'compile', but nothing from the Sch namespace ever gets added to it, despite the Brytum lib file being in the classpath.
What do I need to do in order to successfully run the 'build' command with libs like this?
Or, do I need to take a more granular approach using the 'compile' command?
With the help of the nice folks on the Sencha forums, I was able to resolve my build issues. The solution, for me, involved a shim. I added an external shim.js file to my index with as many //#require and //#define directives as needed in order to resolve the dependency issues.
According to the nice folks at Bryntum, once I upgrade from the free-trial version of the Bryntum Scheduler, I will be able to get rid of the shim and simply rely on the sencha.cfg classpath pointing at the Bryntum src.
Also, as an aside, the app.json file is not used in ExtJS apps, its inclusion in the generated files was a bug in build 141 of Cmd v3.
See this thread for more detail.

Resources