File Certificate.php
has 2679 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace SPHERE\Application\Api\Education\Certificate\Generator;
use MOC\V\Component\Template\Component\IBridgeInterface;
Function getSubjectLanes
has a Cognitive Complexity of 192 (exceeds 5 allowed). Consider refactoring. Open
protected function getSubjectLanes(
$personId,
$isSlice = true,
$languagesWithStartLevel = array(),
$TextSize = '14px',
- 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 getSubjectLanesCoswig
has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring. Open
protected function getSubjectLanesCoswig(
$personId,
$isSlice = true,
$languagesWithStartLevel = array(),
$TextSize = '14px',
- 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 getSubjectLanesCustomForChemnitz
has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring. Open
protected function getSubjectLanesCustomForChemnitz(
$personId,
$isSlice = true,
$languagesWithStartLevel = array(),
$TextSize = '14px',
- 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
Method getSubjectLanes
has 312 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getSubjectLanes(
$personId,
$isSlice = true,
$languagesWithStartLevel = array(),
$TextSize = '14px',
Method getOrientationStandard
has 264 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getOrientationStandard($personId, $TextSize = '14px', $IsGradeUnderlined = false)
{
$tblPerson = Person::useService()->getPersonById($personId);
Method getSubjectLanesCoswig
has 211 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getSubjectLanesCoswig(
$personId,
$isSlice = true,
$languagesWithStartLevel = array(),
$TextSize = '14px',
Method getSubjectLanesCustomForChemnitz
has 193 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getSubjectLanesCustomForChemnitz(
$personId,
$isSlice = true,
$languagesWithStartLevel = array(),
$TextSize = '14px',
Method getObligationToVotePartCustomForCoswig
has 187 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getObligationToVotePartCustomForCoswig($personId, $TextSize = '14px', $IsGradeUnderlined = false)
{
$tblPerson = Person::useService()->getPersonById($personId);
Method getProfileStandardNew
has 177 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getProfileStandardNew($personId, $TextSize = '14px', $IsGradeUnderlined = false)
{
$tblPerson = Person::useService()->getPersonById($personId);
Method getProfileStandard
has 170 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getProfileStandard($personId, $TextSize = '14px', $IsGradeUnderlined = false)
{
$tblPerson = Person::useService()->getPersonById($personId);
Function getSubjectLanesForRadebeul
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
protected function getSubjectLanesForRadebeul(
$personId,
$TextColor = 'black',
$TextSize = '13px',
$GradeFieldBackgroundColor = 'rgb(224,226,231)',
- 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
Certificate
has 44 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class Certificate extends Extension
{
/** @var null|Frame $Certificate */
private $Certificate = null;
Method getSignPart
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getSignPart($personId, $isExtended = true, $MarginTop = '25px')
{
$SignSlice = (new Slice());
if ($isExtended) {
$SignSlice->addSection((new Section())
Function getObligationToVotePartCustomForCoswig
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
protected function getObligationToVotePartCustomForCoswig($personId, $TextSize = '14px', $IsGradeUnderlined = false)
{
$tblPerson = Person::useService()->getPersonById($personId);
- 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 getProfileStandard
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
public function getProfileStandard($personId, $TextSize = '14px', $IsGradeUnderlined = false)
{
$tblPerson = Person::useService()->getPersonById($personId);
- 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 getOrientationStandard
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public function getOrientationStandard($personId, $TextSize = '14px', $IsGradeUnderlined = false)
{
$tblPerson = Person::useService()->getPersonById($personId);
- 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 getSchoolName
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
protected function getSchoolName($personId, $MarginTop = '20px')
{
if (($tblSetting = \SPHERE\Application\Setting\Consumer\Consumer::useService()->getSetting(
'Education', 'Certificate', 'Prepare', 'IsSchoolExtendedNameDisplayed'))
- 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
Method getSubjectLanesForRadebeul
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getSubjectLanesForRadebeul(
$personId,
$TextColor = 'black',
$TextSize = '13px',
$GradeFieldBackgroundColor = 'rgb(224,226,231)',
Function getGradeLanesForRadebeul
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
protected function getGradeLanesForRadebeul(
$personId,
$TextColor = 'black',
$TextSize = '13px',
$GradeFieldBackgroundColor = 'rgb(224,226,231)',
- 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 getGradeLanesCoswig
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
protected function getGradeLanesCoswig(
$personId,
$TextSize = '14px',
$IsGradeUnderlined = false,
$MarginTop = '15px'
- 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 getGradeLanes
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
protected function getGradeLanes($personId, $TextSize = '14px', $IsGradeUnderlined = false, $MarginTop = '15px')
{
$GradeSlice = (new Slice());
- 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 getGradeLanesCustomForChemnitz
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
protected function getGradeLanesCustomForChemnitz(
$personId,
$TextSize = '14px',
$IsGradeUnderlined = false,
$MarginTop = '15px'
- 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
Method getGradeLanesCustomForChemnitz
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getGradeLanesCustomForChemnitz(
$personId,
$TextSize = '14px',
$IsGradeUnderlined = false,
$MarginTop = '15px'
Method getGradeLanesForRadebeul
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getGradeLanesForRadebeul(
$personId,
$TextColor = 'black',
$TextSize = '13px',
$GradeFieldBackgroundColor = 'rgb(224,226,231)',
Function getProfileStandardNew
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function getProfileStandardNew($personId, $TextSize = '14px', $IsGradeUnderlined = false)
{
$tblPerson = Person::useService()->getPersonById($personId);
- 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
Method getGradeLanesCoswig
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getGradeLanesCoswig(
$personId,
$TextSize = '14px',
$IsGradeUnderlined = false,
$MarginTop = '15px'
Method getSchoolName
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getSchoolName($personId, $MarginTop = '20px')
{
if (($tblSetting = \SPHERE\Application\Setting\Consumer\Consumer::useService()->getSetting(
'Education', 'Certificate', 'Prepare', 'IsSchoolExtendedNameDisplayed'))
Method getGradeLanes
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getGradeLanes($personId, $TextSize = '14px', $IsGradeUnderlined = false, $MarginTop = '15px')
{
$GradeSlice = (new Slice());
Function buildCertificate
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function buildCertificate($PageList = array())
{
$document = new Document();
- 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
Method getHeadSlice
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getHeadSlice($IsSample, $picturePath = '', $with = '100%', $height = '100%')
{
if ($picturePath != '') {
if ($IsSample) {
$Header = (new Slice())
Method getInfo
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getInfo(
$MarginTop = '10px',
$LineOne = '',
$LineTwo = '',
$LineThree = '',
Method getDescriptionHead
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getDescriptionHead($personId, $isMissing = false)
{
$DescriptionSlice = (new Slice());
if ($isMissing) {
$DescriptionSlice->addSection((new Section())
Method buildCertificate
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function buildCertificate($PageList = array())
{
$document = new Document();
Method getSubjectLanesForRadebeul
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
$personId,
$TextColor = 'black',
$TextSize = '13px',
$GradeFieldBackgroundColor = 'rgb(224,226,231)',
$IsGradeUnderlined = false,
Method setCheckBox
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function setCheckBox($content = ' ', $thicknessInnerLines = '0.5px')
{
return (new Slice())
->addSection((new Section())
->addElementColumn((new Element())
Consider simplifying this complex logical expression. Open
if (isset($languagesWithStartLevel['Lane']) && isset($languagesWithStartLevel['Rank'])
&& $languagesWithStartLevel['Lane'] == $Lane && $languagesWithStartLevel['Rank'] == $count
) {
$hasAdditionalLine['Lane'] = $Lane;
$hasAdditionalLine['Ranking'] = 2;
Consider simplifying this complex logical expression. Open
if (($tblConsumer = \SPHERE\Application\Platform\Gatekeeper\Authorization\Consumer\Consumer::useService()->getConsumerBySession())
&& $tblConsumer->getAcronym() == 'ESZC'
) {
if (strpos(strtolower($tblSubject->getName()), 'naturwissen') !== false
&& $this->getTblDivision()
Method getGradeLanesForRadebeul
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
$personId,
$TextColor = 'black',
$TextSize = '13px',
$GradeFieldBackgroundColor = 'rgb(224,226,231)',
$IsGradeUnderlined = false,
Method getSubjectLanes
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
$personId,
$isSlice = true,
$languagesWithStartLevel = array(),
$TextSize = '14px',
$IsGradeUnderlined = false,
Avoid deeply nested control flow statements. Open
if (($tblStudentSubjectType = Student::useService()->getStudentSubjectTypeByIdentifier('FOREIGN_LANGUAGE'))
&& ($tblStudentSubjectList = Student::useService()->getStudentSubjectAllByStudentAndSubjectType($tblStudent,
$tblStudentSubjectType))
) {
/** @var TblStudentSubject $tblStudentSubject */
Method getInfo
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$MarginTop = '10px',
$LineOne = '',
$LineTwo = '',
$LineThree = '',
$LineFour = '',
Function getHeadSlice
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function getHeadSlice($IsSample, $picturePath = '', $with = '100%', $height = '100%')
{
if ($picturePath != '') {
if ($IsSample) {
$Header = (new Slice())
- 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 ($hasSecondLanguageSecondarySchool) {
// SSW-484
$tillLevel = $tblStudentSubject->getServiceTblLevelTill();
$fromLevel = $tblStudentSubject->getServiceTblLevelFrom();
if (($tblDivision = $this->getTblDivision())
Avoid deeply nested control flow statements. Open
if (($tblCompany = $tblStudentTransfer->getServiceTblCompany())) {
$name = $isSchoolExtendedNameDisplayed ? $tblCompany->getName() .
($separator ? ' ' . $separator . ' ' : ' ') . $tblCompany->getExtendedName() : $tblCompany->getName();
if (strlen($name) > 60) {
$isLargeCompanyName = true;
Avoid deeply nested control flow statements. Open
if ($tblStudentSubject->getTblStudentSubjectRanking()
&& $tblStudentSubject->getTblStudentSubjectRanking()->getIdentifier() == '2'
&& ($tblSubjectForeignLanguage = $tblStudentSubject->getServiceTblSubject())
) {
$tblSecondForeignLanguage = $tblSubjectForeignLanguage;
Avoid deeply nested control flow statements. Open
if ($hasSecondLanguageDiploma) {
$tblSecondForeignLanguageDiploma = $tblSubjectForeignLanguage;
}
Avoid deeply nested control flow statements. Open
if (($tblStudentSubjectType = Student::useService()->getStudentSubjectTypeByIdentifier('FOREIGN_LANGUAGE'))
&& ($tblStudentSubjectList = Student::useService()->getStudentSubjectAllByStudentAndSubjectType($tblStudent,
$tblStudentSubjectType))
) {
/** @var TblStudentSubject $tblStudentSubject */
Method getSubjectLanesCustomForChemnitz
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$personId,
$isSlice = true,
$languagesWithStartLevel = array(),
$TextSize = '14px',
$IsGradeUnderlined = false
Method getSubjectLanesCoswig
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$personId,
$isSlice = true,
$languagesWithStartLevel = array(),
$TextSize = '14px',
$IsGradeUnderlined = false
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function getOrientationStandard($personId, $TextSize = '14px', $IsGradeUnderlined = false)
{
$tblPerson = Person::useService()->getPersonById($personId);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 1861.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
protected function getSignPart($personId, $isExtended = true, $MarginTop = '25px')
{
$SignSlice = (new Slice());
if ($isExtended) {
$SignSlice->addSection((new Section())
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 617.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (!empty($languagesWithStartLevel)) {
if (isset($languagesWithStartLevel['Lane']) && isset($languagesWithStartLevel['Rank'])) {
$SubjectStructure[$languagesWithStartLevel['Rank']]
[$languagesWithStartLevel['Lane']]['SubjectAcronym'] = 'Empty';
$SubjectStructure[$languagesWithStartLevel['Rank']]
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 253.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (!empty($languagesWithStartLevel)) {
if (isset($languagesWithStartLevel['Lane']) && isset($languagesWithStartLevel['Rank'])) {
$SubjectStructure[$languagesWithStartLevel['Rank']]
[$languagesWithStartLevel['Lane']]['SubjectAcronym'] = 'Empty';
$SubjectStructure[$languagesWithStartLevel['Rank']]
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 253.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
protected function getDivisionAndYear($personId, $MarginTop = '20px', $YearString = 'Schuljahr')
{
$YearDivisionSlice = (new Slice());
$YearDivisionSlice->addSection((new Section())
->addElementColumn((new Element())
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 185.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
protected function setCheckBox($content = ' ', $thicknessInnerLines = '0.5px')
{
return (new Slice())
->addSection((new Section())
->addElementColumn((new Element())
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 176.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 7 locations. Consider refactoring. Open
foreach ($tblCertificateSubjectAll as $tblCertificateSubject) {
$tblSubject = $tblCertificateSubject->getServiceTblSubject();
if($tblSubject){
// Grade Exists? => Add Subject to Certificate
if (isset($tblGradeList['Data'][$tblSubject->getAcronym()])) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 162.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 7 locations. Consider refactoring. Open
foreach ($tblCertificateSubjectAll as $tblCertificateSubject) {
$tblSubject = $tblCertificateSubject->getServiceTblSubject();
if ($tblSubject) {
// Grade Exists? => Add Subject to Certificate
if (isset($tblGradeList['Data'][$tblSubject->getAcronym()])) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 162.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 7 locations. Consider refactoring. Open
foreach ($tblCertificateSubjectAll as $tblCertificateSubject) {
$tblSubject = $tblCertificateSubject->getServiceTblSubject();
if($tblSubject){
// Grade Exists? => Add Subject to Certificate
if (isset($tblGradeList['Data'][$tblSubject->getAcronym()])) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 162.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if ($IsSample) {
$Header = (new Slice())
->addSection((new Section())
->addElementColumn((new Element())
, '25%'
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 136.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (strlen($Subject['SubjectName']) > 20 && preg_match('!\s!', $Subject['SubjectName'])) {
$SubjectSection->addElementColumn((new Element())
->setContent('{% if(Content.P' . $personId . '.Grade.Data["'.$Subject['SubjectAcronym'].'"] is not empty) %}
{{ Content.P' . $personId . '.Grade.Data["'.$Subject['SubjectAcronym'].'"] }}
{% else %}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 133.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
} else {
$SubjectSection->addElementColumn((new Element())
->setContent('{% if(Content.P' . $personId . '.Grade.Data["'.$Subject['SubjectAcronym'].'"] is not empty) %}
{{ Content.P' . $personId . '.Grade.Data["' . $Subject['SubjectAcronym'] . '"] }}
{% else %}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 133.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
} elseif ($elementOrientationName) {
$section = new Section();
$section
->addElementColumn($elementOrientationName, '39%')
->addElementColumn($elementOrientationGrade, '9%')
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 124.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
} elseif ($elementForeignLanguageName) {
$section = new Section();
$section
->addElementColumn($elementForeignLanguageName, '39%')
->addElementColumn($elementForeignLanguageGrade, '9%')
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 124.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ($tblSubjectProfile && !$tblSubjectForeign) {
$elementName = (new Element())
// Profilname aus der Schülerakte
// bei einem Leerzeichen im Acronymn stürzt das TWIG ab
->setContent('
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 103.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ($tblSubjectForeign) {
$elementForeignName = (new Element())
// Profilname aus der Schülerakte
// bei einem Leerzeichen im Acronymn stürzt das TWIG ab
->setContent($tblSubjectForeign->getName())
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 103.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
$SubjectSection->addElementColumn((new Element())
->setContent($hasAdditionalLine['Ranking'] . '. Fremdsprache (ab Klassenstufe ' .
'{% if(Content.P' . $personId . '.Subject.Level["' . $hasAdditionalLine['SubjectAcronym'] . '"] is not empty) %}
{{ Content.P' . $personId . '.Subject.Level["' . $hasAdditionalLine['SubjectAcronym'] . '"] }}
{% else %}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 97.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
$SubjectSection->addElementColumn((new Element())
->setContent($hasAdditionalLine['Ranking'] . '. Fremdsprache (ab Klassenstufe ' .
'{% if(Content.P' . $personId . '.Subject.Level["' . $hasAdditionalLine['SubjectAcronym'] . '"] is not empty) %}
{{ Content.P' . $personId . '.Subject.Level["' . $hasAdditionalLine['SubjectAcronym'] . '"] }}
{% else %}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 97.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ($isLargeCompanyName) {
$SchoolSlice->addSection((new Section())
->addElementColumn((new Element())
->setContent('Name der Schule:')
, '18%')
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 94.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76