critic

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package critic provides tools for identifying refactoring opportunities in code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aibolit added in v0.2.0

type Aibolit struct {
	// contains filtered or unexported fields
}

Aibolit is a tool for identifying refactoring opportunities in Java code. @todo #2:45min Implement support for Aibolit with multiple classes. As for now, we check only the first class, and return imperfections result. Instead, we need to support multiple files instead. Let's implement such Aibolit struct, that will be able to manage whole project, instead of single Java file. Also see this related issue: https://github.com/cqfn/refrax/issues/28.

func NewAibolit added in v0.2.0

func NewAibolit(filename string) *Aibolit

NewAibolit creates a new instance of Aibolit for analyzing a single Java file.

func (*Aibolit) Imperfections added in v0.2.0

func (a *Aibolit) Imperfections() string

Imperfections analyzes the Java code and identifies refactoring opportunities.

type CombinedTool added in v0.2.0

type CombinedTool struct {
	// contains filtered or unexported fields
}

CombinedTool represents a tool that combines multiple tools into one.

func (*CombinedTool) Imperfections added in v0.2.0

func (c *CombinedTool) Imperfections() string

Imperfections gathers and returns the imperfections from all combined tools.

type Critic

type Critic struct {
	// contains filtered or unexported fields
}

Critic represents the main struct responsible for analyzing code critiques.

func NewCritic

func NewCritic(ai brain.Brain, port int, tool ...Tool) *Critic

NewCritic creates and initializes a new instance of Critic.

func (*Critic) Close

func (c *Critic) Close() error

Close gracefully shuts down the Critic server.

func (*Critic) Handler added in v0.2.0

func (c *Critic) Handler(handler protocol.Handler)

Handler sets the message handler for the Critic server.

func (*Critic) Start

func (c *Critic) Start(ready chan<- struct{}) error

Start starts the Critic server and signals readiness via the provided channel.

type MockTool added in v0.2.0

type MockTool struct {
	// contains filtered or unexported fields
}

MockTool represents a mock implementation of the Tool interface.

func (*MockTool) Imperfections added in v0.2.0

func (a *MockTool) Imperfections() string

Imperfections returns the imperfections associated with the MockTool.

type Tool added in v0.2.0

type Tool interface {
	Imperfections() string
}

Tool defines the interface for a tool that can be used to identify and report imperfections in artifacts.

func NewCombinedTool added in v0.2.0

func NewCombinedTool(tls ...Tool) Tool

NewCombinedTool creates a new CombinedTool instance with the provided tools.

func NewMockTool added in v0.2.0

func NewMockTool(data string) Tool

NewMockTool creates a new instance of MockTool with the provided data.

func NewMockToolEmpty added in v0.2.0

func NewMockToolEmpty() Tool

NewMockToolEmpty creates a new instance of MockTool with empty data.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL