Skip to content

Commit bbe7314

Browse files
committed
Python: ObjAPI to ValAPI: WrongNumArgsInCall: Autoformats ObjectAPI.qll
1 parent 7615452 commit bbe7314

File tree

1 file changed

+11
-28
lines changed

1 file changed

+11
-28
lines changed

python/ql/src/semmle/python/objects/ObjectAPI.qll

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -614,9 +614,9 @@ class PythonFunctionValue extends FunctionValue {
614614
override string descriptiveString() {
615615
if this.getScope().isMethod()
616616
then
617-
exists(Class cls | this.getScope().getScope() = cls |
618-
result = "method " + this.getQualifiedName()
619-
)
617+
exists(Class cls | this.getScope().getScope() = cls |
618+
result = "method " + this.getQualifiedName()
619+
)
620620
else result = "function " + this.getQualifiedName()
621621
}
622622

@@ -641,14 +641,9 @@ class PythonFunctionValue extends FunctionValue {
641641
}
642642

643643
/** Gets a control flow node corresponding to a return statement in this function */
644-
ControlFlowNode getAReturnedNode() {
645-
result = this.getScope().getAReturnValueFlowNode()
646-
}
647-
648-
override ClassValue getARaisedType() {
649-
scope_raises(result, this.getScope())
650-
}
644+
ControlFlowNode getAReturnedNode() { result = this.getScope().getAReturnValueFlowNode() }
651645

646+
override ClassValue getARaisedType() { scope_raises(result, this.getScope()) }
652647
}
653648

654649
/** Class representing builtin functions, such as `len` or `print` */
@@ -661,9 +656,7 @@ class BuiltinFunctionValue extends FunctionValue {
661656

662657
override int minParameters() { none() }
663658

664-
override int maxParameters() {
665-
none()
666-
}
659+
override int maxParameters() { none() }
667660

668661
override ClassValue getARaisedType() {
669662
/* Information is unavailable for C code in general */
@@ -685,19 +678,14 @@ class BuiltinMethodValue extends FunctionValue {
685678

686679
override string descriptiveString() { result = "builtin-method " + this.getQualifiedName() }
687680

688-
override int minParameters() {
689-
none()
690-
}
681+
override int minParameters() { none() }
691682

692-
override int maxParameters() {
693-
none()
694-
}
683+
override int maxParameters() { none() }
695684

696685
override ClassValue getARaisedType() {
697686
/* Information is unavailable for C code in general */
698687
none()
699688
}
700-
701689
}
702690

703691
/**
@@ -923,10 +911,8 @@ module ClassValue {
923911
ClassValue lookupError() { result = TBuiltinClassObject(Builtin::builtin("LookupError")) }
924912

925913
/** Get the `ClassValue` for the `IndexError` class. */
926-
ClassValue indexError() {
927-
result = TBuiltinClassObject(Builtin::builtin("IndexError"))
928-
}
929-
914+
ClassValue indexError() { result = TBuiltinClassObject(Builtin::builtin("IndexError")) }
915+
930916
/** Get the `ClassValue` for the `IOError` class. */
931917
ClassValue ioError() { result = TBuiltinClassObject(Builtin::builtin("IOError")) }
932918

@@ -949,8 +935,5 @@ module ClassValue {
949935
}
950936

951937
/** Get the `ClassValue` for the `SystemExit` class. */
952-
ClassValue systemExit() {
953-
result = TBuiltinClassObject(Builtin::builtin("SystemExit"))
954-
}
955-
938+
ClassValue systemExit() { result = TBuiltinClassObject(Builtin::builtin("SystemExit")) }
956939
}

0 commit comments

Comments
 (0)