appthreat / chen Goto Github PK
View Code? Open in Web Editor NEWCode Hierarchy Exploration Net (chen)
Home Page: https://appthreat.com
License: Apache License 2.0
Code Hierarchy Exploration Net (chen)
Home Page: https://appthreat.com
License: Apache License 2.0
chen is now getting released to anaconda.
conda install appthreat::chen
Need to test the package on a fresh environment.
We currently install the science pack using poetry in the container image, which isn't kinda working. Let's switch to conda instead.
https://github.com/AppThreat/chen/blob/main/ci/Dockerfile#L68
It must be possible to include config files from external directories in addition to application directories. This way, files such as BOM can be included for analysis.
We need to start testing the container at some point.
Upstream bug: joernio/joern#3740
class Animal {
public:
virtual void eat() {
std::cout<<"eat nothing";
}
};
class Cat:public Animal {
public:
void eat() {
std::cout<<"eat fish";
}
};
int main( )
{
Cat c;
Animal *a = &c;
a->eat();
return 0;
}
After successful creation, it is trying to load the atom from an incorrect directory.
importCode("/mnt/work/sandbox/node-express-server-rest-api")
Creating project `node-express-server-rest-api` for code at `/mnt/work/sandbox/node-express-server-rest-api`
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Djna.library.path=/home/prabhu/miniconda3/envs/chenpy-dev/lib
Slicing the atom for usages. This might take a few minutes ...
Slices have been successfully written to /mnt/work/AppThreat/chen/usages.json
io.appthreat.console.ConsoleException: Error creating project for input path: `/mnt/work/sandbox/node-express-server-rest-api`
Caused by: java.nio.file.NoSuchFileException: /mnt/work/AppThreat/chen/workspace/node-express-server-rest-api/app.atom
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:261)
at java.base/java.nio.file.Files.newByteChannel(Files.java:379)
at java.base/java.nio.file.Files.newByteChannel(Files.java:431)
at java.base/java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:420)
at java.base/java.nio.file.Files.newInputStream(Files.java:159)
at better.files.File.newInputStream(File.scala:442)
at better.files.File.bytes(File.scala:234)
at io.appthreat.console.cpgcreation.CpgGeneratorFactory.isZipFile(CpgGeneratorFactory.scala:88)
at io.appthreat.console.cpgcreation.CpgGeneratorFactory.runGenerator$$anonfun$1(CpgGeneratorFactory.scala:68)
at scala.util.Success.map(Try.scala:262)
at io.appthreat.console.cpgcreation.CpgGeneratorFactory.runGenerator(CpgGeneratorFactory.scala:77)
at io.appthreat.console.cpgcreation.ImportCode.$anonfun$6(ImportCode.scala:211)
at scala.Option.flatMap(Option.scala:283)
at io.appthreat.console.cpgcreation.ImportCode.io$appthreat$console$cpgcreation$ImportCode$$apply(ImportCode.scala:219)
at io.appthreat.console.cpgcreation.ImportCode.apply(ImportCode.scala:56)
... 39 elided
At some point, miniconda has started installing python 3.12
docker run --rm -v /tmp:/tmp -v $HOME:$HOME -v $(pwd):/app:rw -it ghcr.io/appthreat/chen:main chennai
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Djna.library.path=/opt/miniconda3/lib
java.lang.UnsatisfiedLinkError: Unable to load library 'python3.11':
libpython3.11.so: cannot open shared object file: No such file or directory
libpython3.11.so: cannot open shared object file: No such file or directory
Native library (linux-x86-64/libpython3.11.so) not found in resource path
Method attributes are used by frameworks such as Symfony to specify routes and other information.
// src/Controller/BlogController.php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class BlogController extends AbstractController
{
#[Route('/blog', name: 'blog_list')]
public function list(): Response
{
// ...
}
}
https://www.php.net/manual/en/language.attributes.overview.php
https://symfony.com/doc/current/routing.html
chen predef command is a bit simple
This needs to be enhanced to try the various combinations similar to atom. Otherwise, there are very few results shown for dynamic languages.
This could replace some of the scalapy rich integration code.
We currently use javaparser, which supports Java up to 17. Switching to congocc would also bring support for c#.
Some old php apps define routes using annotations in comments.
use Symfony\Component\Routing\Annotation\Route;
class SomeController
{
/**
* @Route("/path", name="action")
*/
public function someAction()
{
// ...
}
}
https://symfony.com/blog/new-in-symfony-5-2-php-8-attributes
chen --download
ERROR: Could not find a version that satisfies the requirement pyg-lib==0.2.0+pt20cu118 (from versions: none)
ERROR: No matching distribution found for pyg-lib==0.2.0+pt20cu118
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/bin/chen", line 8, in <module>
sys.exit(main())
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chenpy/cli.py", line 177, in main
download_chen_distribution(args.download)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chenpy/cli.py", line 153, in download_chen_distribution
install_science_modules()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chenpy/cli.py", line 164, in install_science_modules
subprocess.check_call(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9', '-m', 'pip', 'install', '-r', '/Users/prabhu/Library/Application Support/chen/chen-science-requirements.txt']' returned non-zero exit status 1.
overflowdb.traversal.filter.StringPropertyFilter$InvalidRegexException: invalid regular expression
Caused by: java.util.regex.PatternSyntaxException: Illegal/unsupported escape sequence near index 9
Exception in thread "main" overflowdb.traversal.filter.StringPropertyFilter$InvalidRegexException: invalid regular expression
Caused by: java.util.regex.PatternSyntaxException: Illegal/unsupported escape sequence near index 9
Full exception output attached.
chen.txt
Collecting uvloop<0.18.0,>=0.17.0 (from appthreat-chen)
Downloading uvloop-0.17.0.tar.gz (2.3 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.3/2.3 MB 2.6 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [20 lines of output]
Traceback (most recent call last):
File "C:\Users\prabhu\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
main()
File "C:\Users\prabhu\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\prabhu\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\prabhu\AppData\Local\Temp\pip-build-env-kr6yxyu5\overlay\Lib\site-packages\setuptools\build_meta.py", line 355, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\prabhu\AppData\Local\Temp\pip-build-env-kr6yxyu5\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in _get_build_requires
self.run_setup()
File "C:\Users\prabhu\AppData\Local\Temp\pip-build-env-kr6yxyu5\overlay\Lib\site-packages\setuptools\build_meta.py", line 507, in run_setup
super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
File "C:\Users\prabhu\AppData\Local\Temp\pip-build-env-kr6yxyu5\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in run_setup
exec(code, locals())
File "<string>", line 8, in <module>
RuntimeError: uvloop does not support Windows at the moment
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.