Skip to content

Commit

Permalink
[refactor] rename to CIAnalyser
Browse files Browse the repository at this point in the history
  • Loading branch information
PAN-Ziyue committed Oct 3, 2022
1 parent b317063 commit 9df430d
Show file tree
Hide file tree
Showing 25 changed files with 61 additions and 84 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
with:
go-version: '^1.18'
- name: Build
run: go build CIHunter
run: go build CIAnalyser
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# :robot: CIHunter
# :robot: CIAnalyser

[![Build](https://github.com/ZJU-SEC/CIHunter/actions/workflows/build.yml/badge.svg)](https://github.com/ZJU-SEC/CIHunter/actions/workflows/build.yml)
[![Build](https://github.com/ZJU-SEC/CIAnalyser/actions/workflows/build.yml/badge.svg)](https://github.com/ZJU-SEC/CIAnalyser/actions/workflows/build.yml)

## :gear: Prerequisite

Expand All @@ -22,20 +22,20 @@ $ docker run \
--restart unless-stopped \
-e POSTGRES_USER=ZJU-SEC \
-e POSTGRES_PASSWORD=<YOUR DB PASSWORD> \
-e POSTGRES_DB=CIHunter \
-e POSTGRES_DB=CIAnalyser \
-p 5432:5432 postgres
```


## :hammer_and_wrench: Build

```bash
$ go build CIHunter
$ go build CIAnalyser
```

## :rocket: Run


```bash
$ ./CIHunter
$ ./CIAnalyser
```
2 changes: 1 addition & 1 deletion config.ini.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ MAX_SINCE = 461660000
HOST = localhost
USER = root
PASSWORD = <YOUR DB PASSWORD>
DBNAME = CIHunter
DBNAME = CIAnalyser
PORT = 5432
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module CIHunter
module CIAnalyser

go 1.18

Expand Down
16 changes: 8 additions & 8 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package main

import (
"CIHunter/config"
"CIHunter/pkg/analyzer"
"CIHunter/pkg/contributor"
"CIHunter/pkg/credential"
"CIHunter/pkg/model"
"CIHunter/pkg/repo"
"CIHunter/pkg/script"
"CIHunter/pkg/verified"
"CIAnalyser/config"
"CIAnalyser/pkg/analyzer"
"CIAnalyser/pkg/contributor"
"CIAnalyser/pkg/credential"
"CIAnalyser/pkg/model"
"CIAnalyser/pkg/repo"
"CIAnalyser/pkg/script"
"CIAnalyser/pkg/verified"
"fmt"
"os"
)
Expand Down
10 changes: 5 additions & 5 deletions pkg/analyzer/analyze.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package analyzer

import (
"CIHunter/config"
"CIHunter/pkg/credential"
"CIHunter/pkg/model"
"CIHunter/pkg/script"
"CIHunter/pkg/verified"
"CIAnalyser/config"
"CIAnalyser/pkg/credential"
"CIAnalyser/pkg/model"
"CIAnalyser/pkg/script"
"CIAnalyser/pkg/verified"
"fmt"
"github.com/go-git/go-git/v5"
"github.com/xuri/excelize/v2"
Expand Down
31 changes: 4 additions & 27 deletions pkg/contributor/crawler.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package contributor

import (
"CIHunter/config"
"CIHunter/pkg/model"
"CIHunter/pkg/script"
"CIHunter/utils"
"CIAnalyser/config"
"CIAnalyser/pkg/model"
"CIAnalyser/pkg/script"
"CIAnalyser/utils"
"encoding/json"
"fmt"
"github.com/gocolly/colly"
Expand Down Expand Up @@ -66,26 +66,3 @@ func crawl(s *script.Script) {

c.Visit(fmt.Sprintf("https://api.github.com/repos/%s/contributors", s.SrcRef()))
}

//import (
// "CIHunter/pkg/model"
// "CIHunter/utils"
// "fmt"
// "github.com/gocolly/colly"
// "strconv"
// "strings"
// "time"
//)
//
//package maintainers
//
//import (
//"CIHunter/pkg/model"
//"CIHunter/utils"
//"fmt"
//"github.com/gocolly/colly"
//"strconv"
//"strings"
//"time"
//)
//
4 changes: 2 additions & 2 deletions pkg/contributor/model.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package contributor

import (
"CIHunter/pkg/model"
"CIHunter/pkg/script"
"CIAnalyser/pkg/model"
"CIAnalyser/pkg/script"
"fmt"
"gorm.io/gorm/clause"
"sync"
Expand Down
6 changes: 3 additions & 3 deletions pkg/credential/extract.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package credential

import (
"CIHunter/config"
"CIHunter/pkg/model"
"CIHunter/utils"
"CIAnalyser/config"
"CIAnalyser/pkg/model"
"CIAnalyser/utils"
"github.com/shomali11/parallelizer"
"io/ioutil"
"strings"
Expand Down
2 changes: 1 addition & 1 deletion pkg/credential/model.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package credential

import (
"CIHunter/pkg/model"
"CIAnalyser/pkg/model"
"fmt"
"sync"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/model/models.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package model

import (
"CIHunter/config"
"CIAnalyser/config"
"fmt"
"gorm.io/driver/postgres"
"gorm.io/gorm"
Expand Down
6 changes: 3 additions & 3 deletions pkg/repo/clone.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package repo

import (
"CIHunter/config"
"CIHunter/pkg/model"
"CIHunter/utils"
"CIAnalyser/config"
"CIAnalyser/pkg/model"
"CIAnalyser/utils"
"fmt"
"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing/transport"
Expand Down
6 changes: 3 additions & 3 deletions pkg/repo/index.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package repo

import (
"CIHunter/config"
"CIHunter/pkg/model"
"CIHunter/utils"
"CIAnalyser/config"
"CIAnalyser/pkg/model"
"CIAnalyser/utils"
"encoding/json"
"fmt"
"github.com/gocolly/colly"
Expand Down
4 changes: 2 additions & 2 deletions pkg/repo/model.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package repo

import (
"CIHunter/config"
"CIHunter/pkg/model"
"CIAnalyser/config"
"CIAnalyser/pkg/model"
"fmt"
"gorm.io/gorm"
"path"
Expand Down
6 changes: 3 additions & 3 deletions pkg/script/categorize.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package script

import (
"CIHunter/config"
"CIHunter/pkg/model"
"CIHunter/utils"
"CIAnalyser/config"
"CIAnalyser/pkg/model"
"CIAnalyser/utils"
"github.com/gocolly/colly"
"github.com/shomali11/parallelizer"
"golang.org/x/exp/slices"
Expand Down
4 changes: 2 additions & 2 deletions pkg/script/clone.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package script

import (
"CIHunter/config"
"CIHunter/pkg/model"
"CIAnalyser/config"
"CIAnalyser/pkg/model"
"fmt"
"github.com/go-git/go-git/v5"
"github.com/shomali11/parallelizer"
Expand Down
8 changes: 4 additions & 4 deletions pkg/script/extract.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package script

import (
"CIHunter/config"
"CIHunter/pkg/model"
"CIHunter/pkg/verified"
"CIHunter/utils"
"CIAnalyser/config"
"CIAnalyser/pkg/model"
"CIAnalyser/pkg/verified"
"CIAnalyser/utils"
"github.com/shomali11/parallelizer"
"io/ioutil"
"strings"
Expand Down
2 changes: 1 addition & 1 deletion pkg/script/lag.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package script

import (
"CIHunter/pkg/model"
"CIAnalyser/pkg/model"
"fmt"
"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing"
Expand Down
4 changes: 2 additions & 2 deletions pkg/script/model.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package script

import (
"CIHunter/config"
"CIHunter/pkg/model"
"CIAnalyser/config"
"CIAnalyser/pkg/model"
"fmt"
"gorm.io/gorm/clause"
"path"
Expand Down
4 changes: 2 additions & 2 deletions pkg/script/using.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package script

import (
"CIHunter/config"
"CIHunter/pkg/model"
"CIAnalyser/config"
"CIAnalyser/pkg/model"
"fmt"
"gopkg.in/yaml.v3"
"os"
Expand Down
2 changes: 1 addition & 1 deletion pkg/script/version.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package script

import (
"CIHunter/pkg/model"
"CIAnalyser/pkg/model"
"fmt"
"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing"
Expand Down
4 changes: 2 additions & 2 deletions pkg/verified/crawler.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package verified

import (
"CIHunter/pkg/model"
"CIHunter/utils"
"CIAnalyser/pkg/model"
"CIAnalyser/utils"
"fmt"
"github.com/gocolly/colly"
"strconv"
Expand Down
2 changes: 1 addition & 1 deletion pkg/verified/model.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package verified

import (
"CIHunter/pkg/model"
"CIAnalyser/pkg/model"
"golang.org/x/exp/slices"
"gorm.io/gorm/clause"
"sync"
Expand Down
4 changes: 2 additions & 2 deletions utils/traverse.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package utils

import (
"CIHunter/config"
"CIHunter/pkg/model"
"CIAnalyser/config"
"CIAnalyser/pkg/model"
"github.com/shomali11/parallelizer"
"gopkg.in/yaml.v3"
"io/fs"
Expand Down
2 changes: 1 addition & 1 deletion utils/utils.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package utils

import (
"CIHunter/config"
"CIAnalyser/config"
"fmt"
"github.com/gocolly/colly"
"math/rand"
Expand Down

0 comments on commit 9df430d

Please sign in to comment.