Skip to content

Commit

Permalink
Merge branch 'master' into incremental-remedies
Browse files Browse the repository at this point in the history
  • Loading branch information
mcserep authored May 8, 2024
2 parents 72c6a6b + e681750 commit de77e87
Show file tree
Hide file tree
Showing 24 changed files with 1,661 additions and 413 deletions.
19 changes: 7 additions & 12 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@ on:
schedule:
- cron: '22 16 * * 5'

permissions:
# required for all workflows
security-events: write
# only required for workflows in private repositories
actions: read
contents: read

jobs:
analyze-jsts:
name: Analyze JavaScript-TypeScript
runs-on: ubuntu-22.04
timeout-minutes: 360
permissions:
# required for all workflows
security-events: write
# only required for workflows in private repositories
actions: read
contents: read

steps:
- name: Checkout repository
Expand All @@ -45,12 +46,6 @@ jobs:
DOWNLOAD_PATH: ${{github.workspace}}/dependencies/download
runs-on: ubuntu-22.04
timeout-minutes: 360
permissions:
# required for all workflows
security-events: write
# only required for workflows in private repositories
actions: read
contents: read

steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion doc/deps.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ The ODB installation uses the build2 build system. (Build2 is not needed for
CodeCompass so you may delete it right after the installation of ODB.)

```bash
wget https://github.com/Ericsson/CodeCompass/blob/master/scripts/install_latest_build2.sh
wget https://raw.githubusercontent.com/Ericsson/CodeCompass/master/scripts/install_latest_build2.sh
sh install_latest_build2.sh "<build2_install_dir>"
```

Expand Down
10 changes: 10 additions & 0 deletions model/include/model/file.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,16 @@ struct FileIdView
{
FileId id;
};

#pragma db view object(File)
struct FilePathView
{
#pragma db column(File::id)
FileId id;

#pragma db column(File::path)
std::string path;
};

#pragma db view object(File) query((?) + " GROUP BY " + File::type)
struct FileTypeView
Expand Down
12 changes: 12 additions & 0 deletions plugins/cpp/model/include/model/cppastnode.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,18 @@ struct AstCountGroupByFiles
std::size_t count;
};

#pragma db view \
object(CppAstNode) \
object(File = LocFile : CppAstNode::location.file)
struct CppAstNodeFilePath
{
#pragma db column(CppAstNode::id)
CppAstNodeId id;

#pragma db column(LocFile::path)
std::string path;
};

#pragma db view object(CppAstNode)
struct CppAstCount
{
Expand Down
22 changes: 22 additions & 0 deletions plugins/cpp/model/include/model/cppfunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ struct CppFunction : CppTypedEntity
std::vector<odb::lazy_shared_ptr<CppVariable>> parameters;
#pragma db on_delete(cascade)
std::vector<odb::lazy_shared_ptr<CppVariable>> locals;

unsigned int mccabe;
unsigned int bumpiness;
unsigned int statementCount;

std::string toString() const
{
Expand Down Expand Up @@ -82,6 +85,25 @@ struct CppFunctionMcCabe
std::string filePath;
};

#pragma db view \
object(CppFunction) \
object(CppAstNode : CppFunction::astNodeId == CppAstNode::id) \
object(File : CppAstNode::location.file)
struct CppFunctionBumpyRoad
{
#pragma db column(CppEntity::astNodeId)
CppAstNodeId astNodeId;

#pragma db column(CppFunction::bumpiness)
unsigned int bumpiness;

#pragma db column(CppFunction::statementCount)
unsigned int statementCount;

#pragma db column(File::path)
std::string filePath;
};

}
}

Expand Down
3 changes: 2 additions & 1 deletion plugins/cpp/parser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ add_library(cppparser SHARED
src/ppmacrocallback.cpp
src/relationcollector.cpp
src/doccommentformatter.cpp
src/diagnosticmessagehandler.cpp)
src/diagnosticmessagehandler.cpp
src/nestedscope.cpp)

target_link_libraries(cppparser
cppmodel
Expand Down
Loading

0 comments on commit de77e87

Please sign in to comment.