Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions comp-cli/src/person.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@ def __init__(self, first=None, last=None):
self.gender = None
self.religion = None
self.compensation = 0
return self

def store_religion(self, religion):
self.religion = religion

def compute_pay(self):
# TODO: something
# TODO: something
# TODO: something
if self.gender == Person.MALE:
self.compensation = SOME_VALUE
elif self.gender == Person.FEMALE:
Expand Down
2 changes: 2 additions & 0 deletions comp-dotnet/project/MyClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ public class MyClass
{
public string ReturnMessage()
{
int await = 42;
int async = 42;
return "Happy coding!";
}
}
Expand Down
2 changes: 1 addition & 1 deletion comp-dotnet/project/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace HelloWorld
{
class Program
static class Program
{
static void Main(string[] args)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
is_global = true
build_property.RootNamespace = dotnet_sample
build_property.ProjectDir = /Users/theil.bise/repos/monorepo/Monorepo-Example/comp-dotnet/project/
build_property.ProjectDir = /Users/theil.bise/repos/monorepo/GitHub-Monorepo-Example/comp-dotnet/project/
Binary file not shown.
25 changes: 17 additions & 8 deletions comp-maven/src/main/java/coverage_metrics/CoverageMetrics.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package coverage_metrics;

import java.security.SecureRandom;
import java.util.List;

/*
*
Expand Down Expand Up @@ -89,14 +90,22 @@ public static boolean all0sAnd1s(String val){
}
return all;
}
private int generateRandom() throws java.io.UnsupportedEncodingException{
SecureRandom sr = new SecureRandom();
sr.setSeed(123456L);
int v = sr.nextInt(32);

sr = new SecureRandom("abcdefghijklmnop".getBytes("us-ascii"));
v = sr.nextInt(32);
return v;

}

class Entity implements Cloneable { // Noncompliant, using `Cloneable`

public int value;
public List<Entity> children; // deep copy wanted

@Override
public Entity clone() {
try {
Entity copy = (Entity) super.clone(); // invariant not enforced, because no constructor is caled
copy.children = children.stream().map(Entity::clone).toList();
return copy;
} catch (CloneNotSupportedException e) { // this will not happen due to behavioral contract
throw new AssertionError();
}
}
}