Skip to content

feat: Add support for class hierarchy resolution#39

Merged
abhisek merged 11 commits intomainfrom
feat/add-support-for-class-inheritence
Aug 6, 2025
Merged

feat: Add support for class hierarchy resolution#39
abhisek merged 11 commits intomainfrom
feat/add-support-for-class-inheritence

Conversation

@abhisek
Copy link
Copy Markdown
Member

@abhisek abhisek commented Aug 5, 2025

  • feat: Add support for class inheritence resolution
  • feat: Add support for Python class resolution

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Aug 5, 2025

Codecov Report

❌ Patch coverage is 79.74537% with 175 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.84%. Comparing base (312e67f) to head (3cdfa8c).

Files with missing lines Patch % Lines
lang/python_resolvers.go 62.10% 54 Missing and 18 partials ⚠️
lang/java_resolvers.go 78.50% 34 Missing and 15 partials ⚠️
core/ast/inheritance.go 90.06% 25 Missing and 7 partials ⚠️
core/ast/class_decl.go 82.25% 16 Missing and 6 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #39      +/-   ##
==========================================
+ Coverage   49.55%   56.84%   +7.28%     
==========================================
  Files          44       46       +2     
  Lines        2797     3661     +864     
==========================================
+ Hits         1386     2081     +695     
- Misses       1298     1421     +123     
- Partials      113      159      +46     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@abhisek abhisek force-pushed the feat/add-support-for-class-inheritence branch from 95bf5f8 to debccb3 Compare August 5, 2025 15:51
@abhisek abhisek marked this pull request as ready for review August 6, 2025 04:24
Copilot AI review requested due to automatic review settings August 6, 2025 04:24

This comment was marked as outdated.

@abhisek abhisek requested a review from Copilot August 6, 2025 05:10
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Aug 6, 2025

vet Summary Report

This report is generated by vet

Policy Checks

  • ✅ Vulnerability
  • ✅ Malware
  • ✅ License
  • ❌ Popularity
  • ❌ Maintenance
  • ✅ Security Posture
  • ✅ Threats

Malicious Package Analysis

Malicious package analysis was performed using SafeDep Cloud API

Malicious Package Analysis Report
Ecosystem Package Version Status Report
ECOSYSTEM_GO github.com/go-logr/stdr 1.2.2 🔗
ECOSYSTEM_GO go.opentelemetry.io/otel/sdk 1.36.0 🔗
ECOSYSTEM_GO google.golang.org/grpc 1.72.2 🔗
ECOSYSTEM_GO github.com/inconshreveable/mousetrap 1.1.0 🔗
ECOSYSTEM_GO go.opentelemetry.io/otel/trace 1.36.0 🔗
ECOSYSTEM_GO github.com/spf13/cobra 1.9.1 🔗
ECOSYSTEM_GO go.opentelemetry.io/otel 1.36.0 🔗
ECOSYSTEM_GO go.opentelemetry.io/otel/exporters/otlp/otlptrace 1.36.0 🔗
ECOSYSTEM_GO github.com/grpc-ecosystem/grpc-gateway/v2 2.26.3 🔗
ECOSYSTEM_GO golang.org/x/net 0.40.0 🔗
ECOSYSTEM_GO go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp 0.61.0 🔗
ECOSYSTEM_GO github.com/cenkalti/backoff/v5 5.0.2 🔗
ECOSYSTEM_GO golang.org/x/sys 0.33.0 🔗
ECOSYSTEM_GO go.opentelemetry.io/otel/metric 1.36.0 🔗
ECOSYSTEM_GO github.com/safedep/dry 0.0.0-20250716064316-9afa8962ced6 🔗
ECOSYSTEM_GO github.com/felixge/httpsnoop 1.0.4 🔗
ECOSYSTEM_GO github.com/beorn7/perks 1.0.1 🔗
ECOSYSTEM_GO github.com/cespare/xxhash/v2 2.3.0 🔗
ECOSYSTEM_GO github.com/prometheus/client_golang 1.22.0 🔗
ECOSYSTEM_GO go.opentelemetry.io/auto/sdk 1.1.0 🔗
ECOSYSTEM_GO go.opentelemetry.io/proto/otlp 1.7.0 🔗
ECOSYSTEM_GO github.com/go-logr/logr 1.4.3 🔗
ECOSYSTEM_GO github.com/prometheus/procfs 0.16.1 🔗
ECOSYSTEM_GO github.com/prometheus/client_model 0.6.2 🔗
ECOSYSTEM_GO github.com/prometheus/common 0.64.0 🔗
ECOSYSTEM_GO github.com/spf13/pflag 1.0.6 🔗
ECOSYSTEM_GO github.com/munnerz/goautoneg 0.0.0-20191010083416-a7dc8b61c822 🔗
ECOSYSTEM_GO go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc 1.36.0 🔗
ECOSYSTEM_GO github.com/google/uuid 1.6.0 🔗
  • ℹ️ 29 packages have been actively analyzed for malicious behaviour.
  • ✅ No malicious packages found.
Changed Packages

Changed Packages

  • ⚠️ [Go] github.com/go-logr/stdr@1.2.2
  • ⚠️ [Go] github.com/beorn7/perks@1.0.1
  • ✅ [Go] github.com/cenkalti/backoff/v5@5.0.2
  • ✅ [Go] go.opentelemetry.io/otel/metric@1.36.0
  • ✅ [Go] github.com/spf13/cobra@1.9.1
  • ✅ [Go] github.com/prometheus/client_golang@1.22.0
  • ⚠️ [Go] github.com/felixge/httpsnoop@1.0.4
  • ✅ [Go] github.com/grpc-ecosystem/grpc-gateway/v2@2.26.3
  • ✅ [Go] go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@0.61.0
  • ✅ [Go] github.com/go-logr/logr@1.4.3
  • ⚠️ [Go] github.com/cespare/xxhash/v2@2.3.0
  • ✅ [Go] go.opentelemetry.io/auto/sdk@1.1.0
  • ✅ [Go] golang.org/x/net@0.40.0
  • ✅ [Go] go.opentelemetry.io/otel/trace@1.36.0
  • ✅ [Go] go.opentelemetry.io/otel/sdk@1.36.0
  • ✅ [Go] go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc@1.36.0
  • ✅ [Go] google.golang.org/grpc@1.72.2
  • ⚠️ [Go] github.com/google/uuid@1.6.0
  • ✅ [Go] github.com/prometheus/procfs@0.16.1
  • ⚠️ [Go] github.com/inconshreveable/mousetrap@1.1.0
  • ⚠️ [Go] github.com/safedep/dry@0.0.0-20250716064316-9afa8962ced6
  • ✅ [Go] golang.org/x/sys@0.33.0
  • ✅ [Go] github.com/prometheus/common@0.64.0
  • ✅ [Go] go.opentelemetry.io/otel@1.36.0
  • ✅ [Go] github.com/spf13/pflag@1.0.6
  • ✅ [Go] go.opentelemetry.io/otel/exporters/otlp/otlptrace@1.36.0
  • ⚠️ [Go] github.com/munnerz/goautoneg@0.0.0-20191010083416-a7dc8b61c822
  • ✅ [Go] github.com/prometheus/client_model@0.6.2
  • ✅ [Go] go.opentelemetry.io/proto/otlp@1.7.0
Policy Violations

Packages Violating Policy

[Go] github.com/go-logr/stdr@1.2.2 🔗

  • ➡️ Found in manifest go.mod
  • ⚠️ Component appears to be unmaintained

[Go] github.com/beorn7/perks@1.0.1 🔗

  • ➡️ Found in manifest go.mod
  • ⚠️ Component appears to be unmaintained

[Go] github.com/felixge/httpsnoop@1.0.4 🔗

  • ➡️ Found in manifest go.mod
  • ⚠️ Component appears to be unmaintained

[Go] github.com/cespare/xxhash/v2@2.3.0 🔗

  • ➡️ Found in manifest go.mod
  • ⚠️ Component appears to be unmaintained

[Go] github.com/google/uuid@1.6.0 🔗

  • ➡️ Found in manifest go.mod
  • ⚠️ Component appears to be unmaintained

[Go] github.com/inconshreveable/mousetrap@1.1.0 🔗

  • ➡️ Found in manifest go.mod
  • ⚠️ Component appears to be unmaintained

[Go] github.com/safedep/dry@0.0.0-20250716064316-9afa8962ced6 🔗

  • ➡️ Found in manifest go.mod
  • ⚠️ Component popularity is low by Github stars count
  • ⚡ Use an alternative package that is popular

[Go] github.com/munnerz/goautoneg@0.0.0-20191010083416-a7dc8b61c822 🔗

  • ➡️ Found in manifest go.mod
  • ⚠️ Component popularity is low by Github stars count
  • ⚡ Use an alternative package that is popular

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements class hierarchy resolution capabilities for Python and Java languages. It adds support for extracting class declarations, analyzing inheritance relationships, and building inheritance graphs from parsed code.

Key Changes:

  • Implements ObjectOrientedLanguageResolvers interface for Python and Java
  • Adds AST nodes for class declarations and inheritance graphs
  • Creates comprehensive test suites with real fixture files for both languages

Reviewed Changes

Copilot reviewed 20 out of 21 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
core/language.go Defines ObjectOrientedLanguageResolvers interface with class and inheritance resolution methods
core/ast/class_decl.go Implements ClassDeclarationNode for representing class definitions with inheritance support
core/ast/inheritance.go Implements InheritanceGraph for managing class hierarchy relationships and analysis
lang/python_resolvers.go Adds Python-specific class and inheritance resolution using Tree-Sitter queries
lang/java_resolvers.go Adds Java-specific class and inheritance resolution using Tree-Sitter queries
lang/*_integration_test.go Comprehensive integration tests for class resolution in both languages
lang/fixtures/*.py, *.java Test fixtures demonstrating various inheritance patterns

Comment thread lang/python_resolvers.go
Comment thread lang/java_resolvers.go
Comment thread lang/java_resolvers.go
Comment thread core/ast/inheritance.go
Comment thread lefthook.yml
abhisek and others added 3 commits August 6, 2025 10:53
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Abhisek Datta <abhisek.datta@gmail.com>
@abhisek abhisek merged commit 2d32b8d into main Aug 6, 2025
4 of 5 checks passed
@abhisek abhisek deleted the feat/add-support-for-class-inheritence branch August 6, 2025 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants