Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit 8b397c1

Browse files
committed
Remove this. from the generated method and interface models
1 parent 539127b commit 8b397c1

41 files changed

Lines changed: 270 additions & 273 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ql/src/semmle/go/frameworks/stdlib/ArchiveZip.qll

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,16 @@ module ArchiveZip {
3838
FunctionOutput outp;
3939

4040
MethodModels() {
41-
// Methods:
4241
// signature: func (*File).Open() (io.ReadCloser, error)
43-
this.(Method).hasQualifiedName("archive/zip", "File", "Open") and
42+
hasQualifiedName("archive/zip", "File", "Open") and
4443
(inp.isReceiver() and outp.isResult(0))
4544
or
4645
// signature: func (*Writer).Create(name string) (io.Writer, error)
47-
this.(Method).hasQualifiedName("archive/zip", "Writer", "Create") and
46+
hasQualifiedName("archive/zip", "Writer", "Create") and
4847
(inp.isResult(0) and outp.isReceiver())
4948
or
5049
// signature: func (*Writer).CreateHeader(fh *FileHeader) (io.Writer, error)
51-
this.(Method).hasQualifiedName("archive/zip", "Writer", "CreateHeader") and
50+
hasQualifiedName("archive/zip", "Writer", "CreateHeader") and
5251
(inp.isResult(0) and outp.isReceiver())
5352
}
5453

ql/src/semmle/go/frameworks/stdlib/Bufio.qll

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module Bufio {
1010
* The function `bufio.NewScanner`.
1111
*/
1212
class NewScanner extends Function {
13-
NewScanner() { this.hasQualifiedName("bufio", "NewScanner") }
13+
NewScanner() { hasQualifiedName("bufio", "NewScanner") }
1414

1515
/**
1616
* Gets the input corresponding to the `io.Reader`
@@ -80,39 +80,39 @@ module Bufio {
8080

8181
MethodModels() {
8282
// signature: func (*Reader).Peek(n int) ([]byte, error)
83-
this.hasQualifiedName("bufio", "Reader", "Peek") and
83+
hasQualifiedName("bufio", "Reader", "Peek") and
8484
(inp.isReceiver() and outp.isResult(0))
8585
or
8686
// signature: func (*Reader).ReadBytes(delim byte) ([]byte, error)
87-
this.hasQualifiedName("bufio", "Reader", "ReadBytes") and
87+
hasQualifiedName("bufio", "Reader", "ReadBytes") and
8888
(inp.isReceiver() and outp.isResult(0))
8989
or
9090
// signature: func (*Reader).ReadLine() (line []byte, isPrefix bool, err error)
91-
this.hasQualifiedName("bufio", "Reader", "ReadLine") and
91+
hasQualifiedName("bufio", "Reader", "ReadLine") and
9292
(inp.isReceiver() and outp.isResult(0))
9393
or
9494
// signature: func (*Reader).ReadSlice(delim byte) (line []byte, err error)
95-
this.hasQualifiedName("bufio", "Reader", "ReadSlice") and
95+
hasQualifiedName("bufio", "Reader", "ReadSlice") and
9696
(inp.isReceiver() and outp.isResult(0))
9797
or
9898
// signature: func (*Reader).ReadString(delim byte) (string, error)
99-
this.hasQualifiedName("bufio", "Reader", "ReadString") and
99+
hasQualifiedName("bufio", "Reader", "ReadString") and
100100
(inp.isReceiver() and outp.isResult(0))
101101
or
102102
// signature: func (*Reader).Reset(r io.Reader)
103-
this.hasQualifiedName("bufio", "Reader", "Reset") and
103+
hasQualifiedName("bufio", "Reader", "Reset") and
104104
(inp.isParameter(0) and outp.isReceiver())
105105
or
106106
// signature: func (*Scanner).Bytes() []byte
107-
this.hasQualifiedName("bufio", "Scanner", "Bytes") and
107+
hasQualifiedName("bufio", "Scanner", "Bytes") and
108108
(inp.isReceiver() and outp.isResult())
109109
or
110110
// signature: func (*Scanner).Text() string
111-
this.hasQualifiedName("bufio", "Scanner", "Text") and
111+
hasQualifiedName("bufio", "Scanner", "Text") and
112112
(inp.isReceiver() and outp.isResult())
113113
or
114114
// signature: func (*Writer).Reset(w io.Writer)
115-
this.hasQualifiedName("bufio", "Writer", "Reset") and
115+
hasQualifiedName("bufio", "Writer", "Reset") and
116116
(inp.isReceiver() and outp.isParameter(0))
117117
}
118118

ql/src/semmle/go/frameworks/stdlib/CompressFlate.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ module CompressFlate {
3939

4040
MethodModels() {
4141
// signature: func (*Writer).Reset(dst io.Writer)
42-
this.hasQualifiedName("compress/flate", "Writer", "Reset") and
42+
hasQualifiedName("compress/flate", "Writer", "Reset") and
4343
(inp.isReceiver() and outp.isParameter(0))
4444
or
4545
// signature: func (Resetter).Reset(r io.Reader, dict []byte) error
46-
this.implements("compress/flate", "Resetter", "Reset") and
46+
implements("compress/flate", "Resetter", "Reset") and
4747
(inp.isParameter(0) and outp.isReceiver())
4848
}
4949

ql/src/semmle/go/frameworks/stdlib/CompressGzip.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ module CompressGzip {
3535

3636
MethodModels() {
3737
// signature: func (*Reader).Reset(r io.Reader) error
38-
this.hasQualifiedName("compress/gzip", "Reader", "Reset") and
38+
hasQualifiedName("compress/gzip", "Reader", "Reset") and
3939
(inp.isParameter(0) and outp.isReceiver())
4040
or
4141
// signature: func (*Writer).Reset(w io.Writer)
42-
this.hasQualifiedName("compress/gzip", "Writer", "Reset") and
42+
hasQualifiedName("compress/gzip", "Writer", "Reset") and
4343
(inp.isReceiver() and outp.isParameter(0))
4444
}
4545

ql/src/semmle/go/frameworks/stdlib/CompressZlib.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ module CompressZlib {
4343

4444
MethodModels() {
4545
// signature: func (*Writer).Reset(w io.Writer)
46-
this.hasQualifiedName("compress/zlib", "Writer", "Reset") and
46+
hasQualifiedName("compress/zlib", "Writer", "Reset") and
4747
(inp.isReceiver() and outp.isParameter(0))
4848
or
4949
// signature: func (Resetter).Reset(r io.Reader, dict []byte) error
50-
this.implements("compress/zlib", "Resetter", "Reset") and
50+
implements("compress/zlib", "Resetter", "Reset") and
5151
(inp.isParameter(0) and outp.isReceiver())
5252
}
5353

ql/src/semmle/go/frameworks/stdlib/ContainerHeap.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ module ContainerHeap {
3535

3636
MethodModels() {
3737
// signature: func (Interface).Pop() interface{}
38-
this.implements("container/heap", "Interface", "Pop") and
38+
implements("container/heap", "Interface", "Pop") and
3939
(inp.isReceiver() and outp.isResult())
4040
or
4141
// signature: func (Interface).Push(x interface{})
42-
this.implements("container/heap", "Interface", "Push") and
42+
implements("container/heap", "Interface", "Push") and
4343
(inp.isParameter(0) and outp.isReceiver())
4444
}
4545

ql/src/semmle/go/frameworks/stdlib/ContainerList.qll

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,79 +12,79 @@ module ContainerList {
1212

1313
MethodModels() {
1414
// signature: func (*Element).Next() *Element
15-
this.hasQualifiedName("container/list", "Element", "Next") and
15+
hasQualifiedName("container/list", "Element", "Next") and
1616
(inp.isReceiver() and outp.isResult())
1717
or
1818
// signature: func (*Element).Prev() *Element
19-
this.hasQualifiedName("container/list", "Element", "Prev") and
19+
hasQualifiedName("container/list", "Element", "Prev") and
2020
(inp.isReceiver() and outp.isResult())
2121
or
2222
// signature: func (*List).Back() *Element
23-
this.hasQualifiedName("container/list", "List", "Back") and
23+
hasQualifiedName("container/list", "List", "Back") and
2424
(inp.isReceiver() and outp.isResult())
2525
or
2626
// signature: func (*List).Front() *Element
27-
this.hasQualifiedName("container/list", "List", "Front") and
27+
hasQualifiedName("container/list", "List", "Front") and
2828
(inp.isReceiver() and outp.isResult())
2929
or
3030
// signature: func (*List).Init() *List
31-
this.hasQualifiedName("container/list", "List", "Init") and
31+
hasQualifiedName("container/list", "List", "Init") and
3232
(inp.isReceiver() and outp.isResult())
3333
or
3434
// signature: func (*List).InsertAfter(v interface{}, mark *Element) *Element
35-
this.hasQualifiedName("container/list", "List", "InsertAfter") and
35+
hasQualifiedName("container/list", "List", "InsertAfter") and
3636
(
3737
inp.isParameter(0) and
3838
(outp.isReceiver() or outp.isResult())
3939
)
4040
or
4141
// signature: func (*List).InsertBefore(v interface{}, mark *Element) *Element
42-
this.hasQualifiedName("container/list", "List", "InsertBefore") and
42+
hasQualifiedName("container/list", "List", "InsertBefore") and
4343
(
4444
inp.isParameter(0) and
4545
(outp.isReceiver() or outp.isResult())
4646
)
4747
or
4848
// signature: func (*List).MoveAfter(e *Element, mark *Element)
49-
this.hasQualifiedName("container/list", "List", "MoveAfter") and
49+
hasQualifiedName("container/list", "List", "MoveAfter") and
5050
(inp.isParameter(0) and outp.isReceiver())
5151
or
5252
// signature: func (*List).MoveBefore(e *Element, mark *Element)
53-
this.hasQualifiedName("container/list", "List", "MoveBefore") and
53+
hasQualifiedName("container/list", "List", "MoveBefore") and
5454
(inp.isParameter(0) and outp.isReceiver())
5555
or
5656
// signature: func (*List).MoveToBack(e *Element)
57-
this.hasQualifiedName("container/list", "List", "MoveToBack") and
57+
hasQualifiedName("container/list", "List", "MoveToBack") and
5858
(inp.isParameter(0) and outp.isReceiver())
5959
or
6060
// signature: func (*List).MoveToFront(e *Element)
61-
this.hasQualifiedName("container/list", "List", "MoveToFront") and
61+
hasQualifiedName("container/list", "List", "MoveToFront") and
6262
(inp.isParameter(0) and outp.isReceiver())
6363
or
6464
// signature: func (*List).PushBack(v interface{}) *Element
65-
this.hasQualifiedName("container/list", "List", "PushBack") and
65+
hasQualifiedName("container/list", "List", "PushBack") and
6666
(
6767
inp.isParameter(0) and
6868
(outp.isReceiver() or outp.isResult())
6969
)
7070
or
7171
// signature: func (*List).PushBackList(other *List)
72-
this.hasQualifiedName("container/list", "List", "PushBackList") and
72+
hasQualifiedName("container/list", "List", "PushBackList") and
7373
(inp.isParameter(0) and outp.isReceiver())
7474
or
7575
// signature: func (*List).PushFront(v interface{}) *Element
76-
this.hasQualifiedName("container/list", "List", "PushFront") and
76+
hasQualifiedName("container/list", "List", "PushFront") and
7777
(
7878
inp.isParameter(0) and
7979
(outp.isReceiver() or outp.isResult())
8080
)
8181
or
8282
// signature: func (*List).PushFrontList(other *List)
83-
this.hasQualifiedName("container/list", "List", "PushFrontList") and
83+
hasQualifiedName("container/list", "List", "PushFrontList") and
8484
(inp.isParameter(0) and outp.isReceiver())
8585
or
8686
// signature: func (*List).Remove(e *Element) interface{}
87-
this.hasQualifiedName("container/list", "List", "Remove") and
87+
hasQualifiedName("container/list", "List", "Remove") and
8888
(inp.isParameter(0) and outp.isResult())
8989
}
9090

ql/src/semmle/go/frameworks/stdlib/ContainerRing.qll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@ module ContainerRing {
1212

1313
MethodModels() {
1414
// signature: func (*Ring).Link(s *Ring) *Ring
15-
this.hasQualifiedName("container/ring", "Ring", "Link") and
15+
hasQualifiedName("container/ring", "Ring", "Link") and
1616
(inp.isParameter(0) and outp.isResult())
1717
or
1818
// signature: func (*Ring).Move(n int) *Ring
19-
this.hasQualifiedName("container/ring", "Ring", "Move") and
19+
hasQualifiedName("container/ring", "Ring", "Move") and
2020
(inp.isReceiver() and outp.isResult())
2121
or
2222
// signature: func (*Ring).Next() *Ring
23-
this.hasQualifiedName("container/ring", "Ring", "Next") and
23+
hasQualifiedName("container/ring", "Ring", "Next") and
2424
(inp.isReceiver() and outp.isResult())
2525
or
2626
// signature: func (*Ring).Prev() *Ring
27-
this.hasQualifiedName("container/ring", "Ring", "Prev") and
27+
hasQualifiedName("container/ring", "Ring", "Prev") and
2828
(inp.isReceiver() and outp.isResult())
2929
or
3030
// signature: func (*Ring).Unlink(n int) *Ring
31-
this.hasQualifiedName("container/ring", "Ring", "Unlink") and
31+
hasQualifiedName("container/ring", "Ring", "Unlink") and
3232
(inp.isReceiver() and outp.isResult())
3333
}
3434

ql/src/semmle/go/frameworks/stdlib/Context.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module Context {
3939

4040
MethodModels() {
4141
// signature: func (Context).Value(key interface{}) interface{}
42-
this.implements("context", "Context", "Value") and
42+
implements("context", "Context", "Value") and
4343
(inp.isReceiver() and outp.isResult())
4444
}
4545

ql/src/semmle/go/frameworks/stdlib/Crypto.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module Crypto {
1212

1313
MethodModels() {
1414
// signature: func (Decrypter).Decrypt(rand io.Reader, msg []byte, opts DecrypterOpts) (plaintext []byte, err error)
15-
this.implements("crypto", "Decrypter", "Decrypt") and
15+
implements("crypto", "Decrypter", "Decrypt") and
1616
(inp.isParameter(1) and outp.isResult(0))
1717
}
1818

0 commit comments

Comments
 (0)