Giter VIP home page Giter VIP logo

appthreat / chen Goto Github PK

View Code? Open in Web Editor NEW
14.0 14.0 1.0 17.72 MB

Code Hierarchy Exploration Net (chen)

Home Page: https://appthreat.com

License: Apache License 2.0

Scala 88.01% Dockerfile 0.15% PHP 0.01% ANTLR 0.01% Java 0.06% Shell 1.16% HCL 0.01% C 0.01% SuperCollider 0.15% Batchfile 0.06% JavaScript 0.01% Python 2.66% Jupyter Notebook 7.72%
code-analysis code-hierarchy-representation dependency-analysis

chen's People

Contributors

prabhu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

cerrussell

chen's Issues

[qa] Test the conda package

chen is now getting released to anaconda.

conda install appthreat::chen 

Need to test the package on a fresh environment.

Include global config files

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.

[predef] importCode command appears to be broken

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

[container] python 3.11 issue

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

[php] support for method attributes

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

[predef] enhance reachables predef to mirror atom's logic

chen predef command is a bit simple

|def reachables(implicit atom: Cpg): Unit = reachables("framework-output", "framework-input", Array("api"))

This needs to be enhanced to try the various combinations similar to atom. Otherwise, there are very few results shown for dynamic languages.

https://github.com/AppThreat/atom/blob/release/2.x/src/main/scala/io/appthreat/atom/slicing/ReachableSlicing.scala#L44

[v1.5] Wish list

  • Completely switch to Java 21, virtual threads, and friends
  • native-image builds (Requires fixes from log4j)

science pack fails to install on a mac

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.

Couple of exceptions when running evinse on javascript projects

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

poetry install issue on windows

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.