dhscanner-bitcode 2.1.1 → 2.2.0
raw patch · 2 files changed
+84/−89 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Callable: [annotationConstantStrings] :: Annotation -> [String]
- Callable: [annotationFqn] :: Annotation -> String
+ Callable: [methodAnnotations] :: MethodContent -> [Annotation]
- Callable: Annotation :: String -> [String] -> Annotation
+ Callable: Annotation :: Location -> Annotation
- Callable: MethodContent :: MethodName -> ClassName -> [HostingClassSuper] -> Cfg -> Location -> Word -> MethodContent
+ Callable: MethodContent :: MethodName -> ClassName -> [HostingClassSuper] -> Cfg -> [Annotation] -> Location -> Word -> MethodContent
Files
- dhscanner-bitcode.cabal +82/−82
- src/Callable.hs +2/−7
dhscanner-bitcode.cabal view
@@ -1,82 +1,82 @@-cabal-version: 3.12 -name: dhscanner-bitcode -category: sast -synopsis: Intermediate language for static code analysis -description: - - The [intermediate language \/ intermediate representation \/ bitcode](https://en.wikipedia.org/wiki/Intermediate_representation#Intermediate_language) - (IL \/ IR \/ bitcode) is a data structure able to represent code originating from /multiple/ - programming languages. Its main purpose is to enable an efficient and uniform /static code analysis/, - as part of the [dhscanner](https://github.com/OrenGitHub/dhscanner) framework - for [CI/CD](https://en.wikipedia.org/wiki/CI/CD) container security checks. - As part of that framework, it targets mostly languages used for /cloud native applications/: - __Python__, __Ruby__, __Php__, __Javascript__, __Typescript__, __Java__, __C#__ and __Golang__. - Typically, a collection of files are first parsed using relevant - [parsers](https://github.com/OrenGitHub/dhscanner.1.parsers), then, - the resulting collection of abstract syntax trees is sent to code generation, - where it is translated into a collection of /callables/. - A callable is a sequence of commands corresponding to either a function, a method - or (in languages like python) a script. The design of commands was done with simplicity - in mind. The commands resemble an abstract RISC-style assembley, motivated by keeping - later-phases analyses as simple as possible. - -version: 2.1.1 -license: GPL-3.0-only -license-file: LICENSE -author: OrenGitHub -maintainer: Oren Ish Shalom -copyright: (c) 2024 Oren Ish Shalom -homepage: https://github.com/OrenGitHub/dhscanner -stability: experimental -build-type: Simple - -common ghc_options - ghc-options: -Wall -Werror=incomplete-patterns -O2 - -library - - import: - ghc_options - - exposed-modules: - Bitcode, - Callable, - Cfg, - Fqn - - build-depends: - aeson >= 2.2 && < 2.4, - base >= 4.22 && < 4.23, - containers >= 0.8 && < 0.9, - dhscanner-ast >= 1.3.1 && < 1.4 - - hs-source-dirs: - src - - default-language: - GHC2024 - -test-suite dhscanner-bitcode-test - - import: - ghc_options - - type: - exitcode-stdio-1.0 - - hs-source-dirs: - test - - main-is: - Main.hs - - build-depends: - base, - dhscanner-ast, - dhscanner-bitcode, - containers, - QuickCheck, - random - - default-language: - GHC2024 +cabal-version: 3.12+name: dhscanner-bitcode+category: sast+synopsis: Intermediate language for static code analysis+description:++ The [intermediate language \/ intermediate representation \/ bitcode](https://en.wikipedia.org/wiki/Intermediate_representation#Intermediate_language)+ (IL \/ IR \/ bitcode) is a data structure able to represent code originating from /multiple/+ programming languages. Its main purpose is to enable an efficient and uniform /static code analysis/,+ as part of the [dhscanner](https://github.com/OrenGitHub/dhscanner) framework+ for [CI/CD](https://en.wikipedia.org/wiki/CI/CD) container security checks.+ As part of that framework, it targets mostly languages used for /cloud native applications/:+ __Python__, __Ruby__, __Php__, __Javascript__, __Typescript__, __Java__, __C#__ and __Golang__.+ Typically, a collection of files are first parsed using relevant+ [parsers](https://github.com/OrenGitHub/dhscanner.1.parsers), then,+ the resulting collection of abstract syntax trees is sent to code generation,+ where it is translated into a collection of /callables/.+ A callable is a sequence of commands corresponding to either a function, a method+ or (in languages like python) a script. The design of commands was done with simplicity+ in mind. The commands resemble an abstract RISC-style assembley, motivated by keeping+ later-phases analyses as simple as possible.++version: 2.2.0+license: GPL-3.0-only+license-file: LICENSE+author: OrenGitHub+maintainer: Oren Ish Shalom+copyright: (c) 2024 Oren Ish Shalom+homepage: https://github.com/OrenGitHub/dhscanner+stability: experimental+build-type: Simple++common ghc_options+ ghc-options: -Wall -Werror=incomplete-patterns -O2++library++ import:+ ghc_options++ exposed-modules:+ Bitcode,+ Callable,+ Cfg,+ Fqn++ build-depends:+ aeson >= 2.2 && < 2.4,+ base >= 4.22 && < 4.23,+ containers >= 0.8 && < 0.9,+ dhscanner-ast >= 1.3.1 && < 1.4++ hs-source-dirs:+ src++ default-language:+ GHC2024++test-suite dhscanner-bitcode-test++ import:+ ghc_options++ type:+ exitcode-stdio-1.0++ hs-source-dirs:+ test++ main-is:+ Main.hs++ build-depends:+ base,+ dhscanner-ast,+ dhscanner-bitcode,+ containers,+ QuickCheck,+ random++ default-language:+ GHC2024
src/Callable.hs view
@@ -68,6 +68,7 @@ hostingClassName :: Token.ClassName, hostingClassSupers :: [ HostingClassSuper ], methodBody :: Cfg, + methodAnnotations :: [ Annotation ], methodLocation :: Location, methodSourceBodyLength :: Word -- ^ number of source-level statements ( see @stmtMethodBody@ in "Ast" ) } @@ -90,13 +91,7 @@ } deriving ( Show, Eq, Ord, Generic, ToJSON, FromJSON ) -data Annotation - = Annotation - { - annotationFqn :: String, - annotationConstantStrings :: [ String ] - } - deriving ( Show, Eq, Ord, Generic, ToJSON, FromJSON ) +data Annotation = Annotation Location deriving ( Show, Eq, Ord, Generic, ToJSON, FromJSON ) data FunctionContent = FunctionContent