Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue sorted #1851

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
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
137 changes: 20 additions & 117 deletions .deepsource.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,5 @@
version = 1

[[analyzers]]
name = "test-coverage"

[[analyzers]]
name = "terraform"

[[analyzers]]
name = "swift"

[[analyzers]]
name = "sql"

[[analyzers]]
name = "shell"

[[analyzers]]
name = "secrets"

[[analyzers]]
name = "scala"

[[analyzers]]
name = "rust"

Expand All @@ -30,48 +9,20 @@ name = "rust"
[[analyzers]]
name = "ruby"

[[analyzers]]
name = "python"

[analyzers.meta]
runtime_version = "3.x.x"

[[analyzers]]
name = "php"

[analyzers.meta]
bootstrap_files = ["bootsrap"]

[[analyzers]]
name = "kotlin"
name = "python"

[analyzers.meta]
runtime_version = "19"
language_version = "1.9"
runtime_version = "3.x.x"

[[analyzers]]
name = "javascript"
name = "go"

[analyzers.meta]
plugins = [
"react",
"ember",
"angularjs",
"vue",
"meteor",
"angular"
]
environment = [
"nodejs",
"browser",
"jest",
"mocha",
"jasmine",
"jquery",
"mongo",
"cypress",
"vitest"
]
import_root = "github.com/SAIVEERENDER24/pi-nexus-autonomous-banking-network"

[[analyzers]]
name = "java"
Expand All @@ -80,79 +31,31 @@ name = "java"
runtime_version = "21"

[[analyzers]]
name = "go"
name = "csharp"

[analyzers.meta]
import_root = "github.com/KOSASIH/pi-nexus-autonomous-banking-network"
[[analyzers]]
name = "scala"

[[analyzers]]
name = "docker"
name = "javascript"

[analyzers.meta]
dockerfile_paths = ["Dockerfile"]
plugins = [
"react",
"vue",
"ember"
]
environment = ["nodejs"]

[[analyzers]]
name = "cxx"
name = "shell"

[[analyzers]]
name = "csharp"
name = "swift"

[[analyzers]]
name = "ansible"

[[transformers]]
name = "dotnet-format"

[[transformers]]
name = "clang-format"

[[transformers]]
name = "gofmt"

[[transformers]]
name = "gofumpt"

[[transformers]]
name = "google-java-format"

[[transformers]]
name = "standardjs"

[[transformers]]
name = "prettier"

[[transformers]]
name = "ktlint"

[[transformers]]
name = "php-cs-fixer"

[[transformers]]
name = "yapf"

[[transformers]]
name = "ruff"

[[transformers]]
name = "black"

[[transformers]]
name = "autopep8"

[[transformers]]
name = "isort"

[[transformers]]
name = "standardrb"

[[transformers]]
name = "rubocop"

[[transformers]]
name = "scalafmt"

[[transformers]]
name = "rustfmt"
name = "kotlin"

[[transformers]]
name = "swift-format"
[analyzers.meta]
runtime_version = "1.8"
language_version = "1.7"
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# fraud_detection.py
import pandas as pd
from sklearn.ensemble import IsolationForest

def detect_fraud(transactions):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const Portfolio = () => {
))}
</TableBody>
</Table>
</div>
</div>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,3 @@ def generate_private_key():
def derive_hd_key(private_key):
# Derive an HD key from the private key
hd_key = HDKey(private_key)
return hd_key
6 changes: 3 additions & 3 deletions core/account-service/tests/AccountServiceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@SpringBootTest
@Testcontainers
@ExtendWith(MockitoExtension.class)
public class AccountServiceTest {
class AccountServiceTest {
@Container
private static final PostgreSQLContainer postgreSQLContainer = new PostgreSQLContainer("postgres:11.1");

Expand All @@ -29,7 +29,7 @@ public void setup() {
}

@Test
public void testGetAccount() {
void testGetAccount() {
// Given
Long accountId = 1L;
Account account = new Account(accountId, "John Doe", "[email protected]");
Expand All @@ -43,7 +43,7 @@ public void testGetAccount() {
}

@Test
public void testCreateAccount() {
void testCreateAccount() {
// Given
Account account = new Account("John Doe", "[email protected]");

Expand Down
6 changes: 3 additions & 3 deletions core/account-service/tests/TransactionServiceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@SpringBootTest
@Testcontainers
@ExtendWith(MockitoExtension.class)
public class TransactionServiceTest {
class TransactionServiceTest {
@Container
private static final KafkaContainer kafkaContainer = new KafkaContainer("confluentinc/cp-kafka:5.5.1");

Expand All @@ -29,7 +29,7 @@ public void setup() {
}

@Test
public void testCreateTransaction() {
void testCreateTransaction() {
// Given
Transaction transaction = new Transaction("John Doe", 100.0);

Expand All @@ -41,7 +41,7 @@ public void testCreateTransaction() {
}

@Test
public void testUpdateTransaction() {
void testUpdateTransaction() {
// Given
Transaction transaction = new Transaction("John Doe", 100.0);

Expand Down
6 changes: 3 additions & 3 deletions core/account-service/tests/UserServiceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@SpringBootTest
@Testcontainers
@ExtendWith(MockitoExtension.class)
public class UserServiceTest {
class UserServiceTest {
@Container
private static final Neo4jContainer neo4jContainer = new Neo4jContainer("neo4j:4.2.1");

Expand All @@ -29,7 +29,7 @@ public void setup() {
}

@Test
public void testFindByUsername() {
void testFindByUsername() {
// Given
String username = "john.doe";
User user = new User(username, "John Doe", "[email protected]");
Expand All @@ -43,7 +43,7 @@ public void testFindByUsername() {
}

@Test
public void testFindByEmail() {
void testFindByEmail() {
// Given
String email = "[email protected]";
User user = new User("john.doe", "John Doe", email);
Expand Down
3 changes: 2 additions & 1 deletion src/ai/nlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ def __init__(self, model_path='nlp_model.pkl'):
self.vectorizer = TfidfVectorizer()
self.model = None

def load_data(self, file_path):
@staticmethod
def load_data(file_path):
"""Load textual data from a CSV file."""
data = pd.read_csv(file_path)
return data
Expand Down
6 changes: 4 additions & 2 deletions src/ai/risk_assessment.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ def __init__(self, model_path='risk_model.pkl'):
self.model_path = model_path
self.model = None

def load_data(self, file_path):
@staticmethod
def load_data(file_path):
"""Load data from a CSV file."""
data = pd.read_csv(file_path)
return data

def preprocess_data(self, data):
@staticmethod
def preprocess_data(data):
"""Preprocess the data for training."""
# Example preprocessing steps
data.fillna(0, inplace=True) # Fill missing values
Expand Down
1 change: 0 additions & 1 deletion src/blockchain/blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import json
from time import time
from urllib.parse import urlparse
from uuid import uuid4

class Blockchain:
def __init__(self):
Expand Down
6 changes: 4 additions & 2 deletions src/blockchain/cross_chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ class CrossChain:
def __init__(self, blockchain):
self.blockchain = blockchain

def send_transaction(self, recipient, amount):
@staticmethod
def send_transaction(recipient, amount):
# Send a transaction to another blockchain
transaction_data = {
'sender': str(uuid4()), # Simulate sender address
Expand All @@ -14,7 +15,8 @@ def send_transaction(self, recipient, amount):
response = requests.post('http://other-blockchain-url/transactions/new', json=transaction_data)
return response.json()

def fetch_chain(self, node):
@staticmethod
def fetch_chain(node):
response = requests.get(f'http://{node}/chain')
if response.status_code == 200:
return response.json()
Expand Down
3 changes: 2 additions & 1 deletion src/payment/fraud_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ def __init__(self):
def log_transaction(self, payment):
self.transaction_history.append(payment)

def detect_fraud(self, payment):
@staticmethod
def detect_fraud(payment):
# Simple fraud detection logic based on transaction patterns
if payment.amount > 10000: # Example threshold
print(f"Fraud alert! High transaction amount detected: {payment.amount} from {payment.payer}.")
Expand Down
3 changes: 2 additions & 1 deletion src/payment/notification.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class Notification:
def send_notification(self,recipient, message):
@staticmethod
def send_notification(recipient, message):
# Here you can implement the logic to send notifications via email, SMS, or any other method
print(f"Notification sent to {recipient}: {message}")
1 change: 0 additions & 1 deletion src/payment/payment_gateway.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import uuid
import time
from cryptography.fernet import Fernet
from notification import Notification

class PaymentGateway:
Expand Down
3 changes: 2 additions & 1 deletion src/security/multi_sig.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ def verify(self, message, signature, signer_index):
except ecdsa.BadSignatureError:
return False

def combine_signatures(self, signatures):
@staticmethod
def combine_signatures(signatures):
combined_signature = b''
for signature in signatures:
combined_signature += signature
Expand Down
6 changes: 4 additions & 2 deletions src/security/privacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ def privatize_data(self, data):
noisy_data = data + np.random.laplace(0, self.epsilon, size=data.shape)
return noisy_data

def train_model(self, X, y):
@staticmethod
def train_model(X, y):
scaler = StandardScaler()
X_scaled = scaler.fit_transform(X)
svm = SVC()
svm.fit(X_scaled, y)
return svm

def evaluate_model(self, model, X, y):
@staticmethod
def evaluate_model(model, X, y):
y_pred = model.predict(X)
accuracy = accuracy_score(y, y_pred)
return accuracy
Expand Down
1 change: 0 additions & 1 deletion src/security/quantum_crypto.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import numpy as np
from qiskit import QuantumCircuit, execute, Aer

class QuantumCrypto:
Expand Down
1 change: 0 additions & 1 deletion src/security/secure_mpc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import numpy as np
from cryptography.fernet import Fernet

class SecureMPC:
Expand Down
Loading
Loading