All Projects → gqlgo → gqlanalysis

gqlgo / gqlanalysis

Licence: MIT license
gqlanalysis makes easy to develop static analysis tools for GraphQL in Go.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to gqlanalysis

inline-plz
Inline your lint messages
Stars: ✭ 32 (-11.11%)
Mutual labels:  static-analysis
ramllint
RAML Linter
Stars: ✭ 18 (-50%)
Mutual labels:  static-analysis
adelaide
The SECBIT Static Analysis Extension to Solidity Compiler
Stars: ✭ 16 (-55.56%)
Mutual labels:  static-analysis
cmake-init
The missing CMake project initializer
Stars: ✭ 1,071 (+2875%)
Mutual labels:  static-analysis
dmn-check
A tool which performs static analyses on Decision Model Notation (DMN) files to detect bugs
Stars: ✭ 34 (-5.56%)
Mutual labels:  static-analysis
phpstan-wordpress
WordPress extensions for PHPStan ⛏️
Stars: ✭ 182 (+405.56%)
Mutual labels:  static-analysis
qulice
Quality Police for Java projects: aggregator of Checkstyle, PMD, and SpotBugs
Stars: ✭ 286 (+694.44%)
Mutual labels:  static-analysis
Scalpel
Scalpel: The Python Static Analysis Framework
Stars: ✭ 176 (+388.89%)
Mutual labels:  static-analysis
phpstan-phpspec
PhpSpec extension for PHPStan
Stars: ✭ 19 (-47.22%)
Mutual labels:  static-analysis
kcc
A Small C Compiler
Stars: ✭ 18 (-50%)
Mutual labels:  static-analysis
lints
Lint all your JavaScript, CSS, HTML, Markdown and Dockerfiles with a single command
Stars: ✭ 14 (-61.11%)
Mutual labels:  static-analysis
bismon
persistent monitor (for static source code analysis, GCC based)
Stars: ✭ 45 (+25%)
Mutual labels:  static-analysis
go-perfguard
CPU-guided performance analyzer for Go
Stars: ✭ 58 (+61.11%)
Mutual labels:  static-analysis
dlint
Dlint is a tool for encouraging best coding practices and helping ensure Python code is secure.
Stars: ✭ 130 (+261.11%)
Mutual labels:  static-analysis
Fortran-Tools
Fortran compilers, preprocessors, static analyzers, transpilers, IDEs, build systems, etc.
Stars: ✭ 31 (-13.89%)
Mutual labels:  static-analysis
swap-detector
A library for detecting swapped arguments in function calls, and a Clang Static Analyzer plugin used to demonstrate the library.
Stars: ✭ 19 (-47.22%)
Mutual labels:  static-analysis
PHPDoctor
🏥 PHPDoctor: Check files, full directories or strings for missing or bad PHPDoc types.
Stars: ✭ 54 (+50%)
Mutual labels:  static-analysis
sonar-css-plugin
SonarQube CSS / SCSS / Less Analyzer
Stars: ✭ 46 (+27.78%)
Mutual labels:  static-analysis
flextool
C++ compile-time programming (serialization, reflection, code modification, enum to string, better enum, enum to json, extend or parse language, etc.)
Stars: ✭ 32 (-11.11%)
Mutual labels:  static-analysis
php-codesniffer-sniffs
Custom sniffs for PHP_CodeSniffer
Stars: ✭ 16 (-55.56%)
Mutual labels:  static-analysis

gqlanalysis

pkg.go.dev

gqlanalysis defines the interface between a modular static analysis for GraphQL in Go. gqlanalysis is inspired by go/analysis.

gqlanalysis makes easy to develop static analysis tools for GraphQL in Go.

How to use

Analyzer

The primary type in the API is Analyzer. An Analyzer statically describes an analysis function: its name, documentation, flags, relationship to other analyzers, and of course, its logic.

package lackid

var Analyzer = &gqlanalysis.Analyzer{
	Name: "lackid",
	Doc:  "lackid finds a selection for a type which has id field but the selection does not have id",
	Run:  run,
	...
}

func run(pass *gqlanalysis.Pass) (interface{}, error) {
	...
}

Driver

An analysis driver is a program that runs a set of analyses and prints the diagnostics that they report. The driver program must import the list of Analyzers it needs.

A typical driver can be created with multichecker package.

package main

import (
        "github.com/gqlgo/gqlanalysis/multichecker"
        "github.com/gqlgo/lackid"
        "github.com/gqlgo/myanalyzer"
)

func main() {
        multichecker.Main(
		lackid.Analyzer,
		myanalyzer.Analyzer,
	)
}

Pass

A Pass describes a single unit of work: the application of a particular Analyzer to given GraphQL's schema and query files. The Pass provides information to the Analyzer's Run function about schemas and queries being analyzed, and provides operations to the Run function for reporting diagnostics and other information back to the driver.

type Pass struct {
        Analyzer *Analyzer

        Schema   *ast.Schema
        Queries  []*ast.QueryDocument
        Comments []*Comment

        Report   func(*Diagnostic)
        ResultOf map[*Analyzer]interface{}
}

Diagnostic

A Diagnostic is a message associated with a source location. Pass can report a diagnostic via Report field or Reportf method.

type Diagnostic struct {
        Pos     *ast.Position
        Message string
}

Implementations of Analyzer

Author

Appify Technologies, Inc.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].