Showing 19 of 43 total issues
File word.py
has 754 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# pattern.py
# Used to detect patterns from a fully vocalized word
File meter.py
has 642 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2019 Abdelkrime Aries <kariminfo0@gmail.com>
#
File foot.py
has 400 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2019 Abdelkrime Aries <kariminfo0@gmail.com>
#
Function getPattern
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def getPattern(word):
tmpPattern = u''
for char in word:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File litebase.py
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# litebase.py
# Used to manage Sqlite database with easiest way
Function process_shatr
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def process_shatr(text, opt=None):
s = prosody.process_shatr(text).to_dict(bahr=True, parts=True)
res = 200
if not s["bahr"]:
res = 404
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getTemplateNoDiac
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def getTemplateNoDiac(word):
"""This function take an Arabic word as parameter;
it deletes its diacritics if exist; then returns the possible Templates;
If there are many possible templates, they will be separated with + """
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
if s["bahr"]:
s["bahr"] = s["bahr"]["name"]
else:
Function get_ameter
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_ameter (text):
"""Get the Arabic meter of a given text.
Produces the Arabic meter of a given text in prosody form.
The Arabic meter is composed of two letters:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function makeLiteType
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def makeLiteType(stringType):
stringType = string.upper(stringType)
if re.match('INT[^\(]', stringType):
return liteINT(0)
if re.match('TEXT', stringType):
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function setPath
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def setPath(self, filePath):
if self.__database:
print 'Database already exists'
return
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid too many return
statements within this function. Open
return liteType(stringType)
Avoid too many return
statements within this function. Open
return liteCHAR(num)
Avoid too many return
statements within this function. Open
return liteINT(num)
Avoid too many return
statements within this function. Open
return liteVARCHAR(num)
Function __addTable
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __addTable(self, sqlQuery):
sqlQuery = u'' + sqlQuery
theLiteTable = liteTable()
tableName = u''
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getTemplateFromList
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def getTemplateFromList(word, template):
"""This function take an Arabic word (diacretized)
and some possible templates separated by a +;
If the program succeed to choose just one, it will add a (;)
at the end
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function get_bahr
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_bahr(name, dic=True):
"""Search for poetry Bahr by name.
Parameters
----------
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function addColumn
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def addColumn(self, columnName, columnDef, columnInf, index):
if not self.__canAddColumns:
return
if len(self.__tableName) < 1:
return
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"