Skip to content

Commit

Permalink
re-organized project files
Browse files Browse the repository at this point in the history
  • Loading branch information
tushartushar committed Mar 18, 2016
1 parent 5db56e8 commit feb9753
Show file tree
Hide file tree
Showing 28 changed files with 260 additions and 217 deletions.
324 changes: 174 additions & 150 deletions .idea/workspace.xml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion Aggregator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Constants as CONSTS
from SmellDetector import Constants as CONSTS


def aggregate(folder, name, outFile):
fileCount = 0
Expand Down
5 changes: 3 additions & 2 deletions Puppet-lint_aggregator/PuppetLintRules.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import os
import Analyzer
import Aggregator

import PLConstants as CONSTS

import Aggregator

root = CONSTS.REPO_ROOT
# print("Initiating Custom Puppet-Lint Analyzer...")
# totalRepos = len(os.listdir(root))
Expand Down
5 changes: 3 additions & 2 deletions Puppet-lint_aggregator/Test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from unittest import TestCase

import Aggregator
import Constants as CONSTS
import Analyzer
from SmellDetector import Constants as CONSTS, Analyzer


class TestAggregator(TestCase):
def test_aggregate(self):
Expand Down
4 changes: 2 additions & 2 deletions Puppeteer.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import Analyzer

import Aggregator
import Constants as CONSTS
from SmellDetector import Constants as CONSTS, Analyzer

root = CONSTS.REPO_ROOT
print("Initiating Analyzer...")
Expand Down
7 changes: 4 additions & 3 deletions AbsSmellDectector.py → SmellDetector/AbsSmellDectector.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import os
import SourceModel.SM_File
import Utilities
import Constants as CONSTS
import re

import SourceModel.SM_File
from SmellDetector import Constants as CONSTS, Utilities


def detectSmells(folder, outputFile):
detectMultifacetedAbs(folder, outputFile)
detectUnnecessaryAbs(folder, outputFile)
Expand Down
8 changes: 3 additions & 5 deletions Analyzer.py → SmellDetector/Analyzer.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import FileOperations
import SizeMetrics
import Constants as CONSTS
import SmellDectector
import Utilities
import SmellDetector.Constants as CONSTS
from SmellDetector import SmellDectector, SizeMetrics, FileOperations, Utilities


def analyze(folder, repoName):
outputFile = open(folder + "/" + CONSTS.PUPPETEER_OUT_FILE, 'w')
Expand Down
File renamed without changes.
7 changes: 3 additions & 4 deletions DepSmellDectector.py → SmellDetector/DepSmellDectector.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import Utilities
import os

import SourceModel.SM_File
import Constants as CONSTS
import FileOperations
import inspect
from SmellDetector import Constants as CONSTS, Utilities


def detectSmells(folder, outputFile):
detectMissingDep(folder, outputFile)
Expand Down
5 changes: 3 additions & 2 deletions EncSmellDectector.py → SmellDetector/EncSmellDectector.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import Utilities
import os

import SourceModel.SM_File
import Constants as CONSTS
from SmellDetector import Constants as CONSTS, Utilities


def detectSmells(folder, outputFile):
detectDeficientEnc(folder, outputFile)
Expand Down
File renamed without changes.
5 changes: 3 additions & 2 deletions HieSmellDectector.py → SmellDetector/HieSmellDectector.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import Utilities
import os
import Constants as CONSTS

import SourceModel.SM_File
from SmellDetector import Constants as CONSTS, Utilities


def detectSmells(folder, outputFile):
detectBrokenHie(folder, outputFile)
Expand Down
13 changes: 7 additions & 6 deletions ModSmellDectector.py → SmellDetector/ModSmellDectector.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import Utilities
import os
import SourceModel.SM_File
import Constants as CONSTS
import FileOperations

import Graph.GR_Constants as GRCONSTS
import Graph.Graph
import Graph.GraphNode
import Graph.Resource
import Graph.GR_Constants as GRCONSTS
import SmellDetector.Constants as CONSTS
import SourceModel.SM_File
from SmellDetector import FileOperations, Utilities


def detectSmells(folder, outputFile):
detectInsufficientMod(folder, outputFile)
Expand Down Expand Up @@ -125,7 +126,7 @@ def detectUnstructuredModForm2(folder, outputFile):

def detectUnsModForm2(folder, outputFile):
if not getManifestsFolder(folder):
Utilities.reportSmell(outputFile,folder, CONSTS.SMELL_UNS_MOD_2, CONSTS.MODULE_MANIFEST)
Utilities.reportSmell(outputFile, folder, CONSTS.SMELL_UNS_MOD_2, CONSTS.MODULE_MANIFEST)

#Form 3 - When a module contains other than recommended folders/files
def detectUnstructuredModForm3(folder, outputFile):
Expand Down
6 changes: 3 additions & 3 deletions SizeMetrics.py → SmellDetector/SizeMetrics.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import os
import re
import Constants as CONSTS

import SourceModel.SM_File
import Utilities
from SmellDetector import Constants as CONSTS, Utilities


def collectSizeMetrics(folder, outputFile):
totalClasses = 0
Expand Down
7 changes: 2 additions & 5 deletions SmellDectector.py → SmellDetector/SmellDectector.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import AbsSmellDectector
import EncSmellDectector
import ModSmellDectector
import DepSmellDectector
import HieSmellDectector
from SmellDetector import AbsSmellDectector, ModSmellDectector, HieSmellDectector, DepSmellDectector, EncSmellDectector


def detectSmells(folder, outputFile):
AbsSmellDectector.detectSmells(folder, outputFile)
Expand Down
3 changes: 2 additions & 1 deletion Utilities.py → SmellDetector/Utilities.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Constants as CONSTS
from SmellDetector import Constants as CONSTS


def myPrint(msg):
if(CONSTS.DEBUG_ON):
Expand Down
Empty file added SmellDetector/__init__.py
Empty file.
13 changes: 7 additions & 6 deletions SourceModel/SM_Class.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import re
import Utilities

import SourceModel.SM_CaseStmt
import SourceModel.SM_Constants as SMCONSTS
import SourceModel.SM_Define
import SourceModel.SM_Element
import SourceModel.SM_Exec
import SourceModel.SM_File
import SourceModel.SM_FileResource
import SourceModel.SM_IfStmt
import SourceModel.SM_LCOM
import SourceModel.SM_PackageResource
import SourceModel.SM_ServiceResource
import SourceModel.SM_CaseStmt
import SourceModel.SM_IfStmt
import SourceModel.SM_User
import SourceModel.SM_Element
import SourceModel.SM_LCOM
import SourceModel.SM_File


class SM_Class(SourceModel.SM_Element.SM_Element):
def __init__(self, text, name=None):
Expand Down
21 changes: 11 additions & 10 deletions SourceModel/SM_File.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import re
import Utilities
import SourceModel.SM_FileResource
import SourceModel.SM_ServiceResource
import SourceModel.SM_PackageResource
import SourceModel.SM_IncludeResource

import SourceModel.SM_CaseStmt
import SourceModel.SM_Class
import SourceModel.SM_LCOM
import SourceModel.SM_Define
import SourceModel.SM_Constants as SMCONSTS
import SourceModel.SM_Define
import SourceModel.SM_Define
import SourceModel.SM_Element
import SourceModel.SM_Exec
import SourceModel.SM_CaseStmt
import SourceModel.SM_FileResource
import SourceModel.SM_IfStmt
import SourceModel.SM_User
import SourceModel.SM_Element
import SourceModel.SM_IncludeResource
import SourceModel.SM_LCOM
import SourceModel.SM_Node
import SourceModel.SM_PackageResource
import SourceModel.SM_ServiceResource
import SourceModel.SM_User
from SmellDetector import Utilities


class SM_File:
Expand Down
6 changes: 4 additions & 2 deletions SourceModel/SM_FileResource.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import re
import Utilities
import SourceModel.SM_Element

import SourceModel.SM_Constants as SMCONSTS
import SourceModel.SM_Element
from SmellDetector import Utilities


class SM_FileResource(SourceModel.SM_Element.SM_Element):
def __init__(self, text):
Expand Down
4 changes: 3 additions & 1 deletion SourceModel/SM_IncludeResource.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import re
import Utilities

import SourceModel.SM_Element
from SmellDetector import Utilities


class SM_IncludeResource(SourceModel.SM_Element.SM_Element):
def __init__(self, text, name=None):
Expand Down
3 changes: 2 additions & 1 deletion SourceModel/SM_LCOM.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Utilities
from SmellDetector import Utilities


def getLCOM(elementList):
disconnectedElements = 0
Expand Down
6 changes: 4 additions & 2 deletions SourceModel/SM_PackageResource.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import re
import Utilities
import SourceModel.SM_Element

import SourceModel.SM_Constants as SMCONSTS
import SourceModel.SM_Element
from SmellDetector import Utilities


class SM_PackageResource(SourceModel.SM_Element.SM_Element):
def __init__(self, text):
Expand Down
6 changes: 4 additions & 2 deletions SourceModel/SM_ServiceResource.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import re
import Utilities
import SourceModel.SM_Element

import SourceModel.SM_Constants as SMCONSTS
import SourceModel.SM_Element
from SmellDetector import Utilities


class SM_ServiceResource(SourceModel.SM_Element.SM_Element):
def __init__(self, text):
Expand Down
3 changes: 2 additions & 1 deletion Tests/test_AbsSmells.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from unittest import TestCase

import SourceModel.SM_File
import AbsSmellDectector
from SmellDetector import AbsSmellDectector


class TestAbsSmells(TestCase):
Expand Down
4 changes: 3 additions & 1 deletion Tests/test_EncSmells.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from unittest import TestCase

import SourceModel.SM_File
import EncSmellDectector
from SmellDetector import EncSmellDectector


class TestModSmells(TestCase):
def test_detectDefEnc(self):
Expand Down
5 changes: 3 additions & 2 deletions Tests/test_HieSmells.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from unittest import TestCase
import SourceModel.SM_File
import HieSmellDectector

from SmellDetector import HieSmellDectector


class TestHieSmells(TestCase):
def test_detectBroHierarchy(self):
Expand Down
4 changes: 3 additions & 1 deletion Tests/test_ModSmells.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from unittest import TestCase

import SourceModel.SM_File
import ModSmellDectector
from SmellDetector import ModSmellDectector


class TestModSmells(TestCase):
def test_detectInsModForm1(self):
Expand Down

0 comments on commit feb9753

Please sign in to comment.