File import.primary.php
has 941 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*******************************************************************************
*
* Import Routine
ImportOrk2
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
class ImportOrk2 {
var $adminuser = 'adminimport';
var $adminpassword = 'e01e44f3';
Function ImportTitles
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
function ImportTitles($number = 5) {
set_time_limit(600);
echo "<h2>Import Titles</h2>";
- 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 ImportCredits
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function ImportCredits($number = 5) {
set_time_limit(600);
echo "<h2>Import Credits</h2>";
- 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 ImportKnights
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function ImportKnights($number = 5) {
set_time_limit(600);
echo "<h2>Import Knights</h2>";
- 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 ImportTitles
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ImportTitles($number = 5) {
set_time_limit(600);
echo "<h2>Import Titles</h2>";
Method ImportCredits
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ImportCredits($number = 5) {
set_time_limit(600);
echo "<h2>Import Credits</h2>";
Function ImportNotes
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function ImportNotes() {
/***************************************************************************
* Notes
* - titles
* - positions
- 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 ImportPlayers
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ImportPlayers($number = 20) {
set_time_limit(120);
echo "<h2>Import Players</h2>";
Function ImportSquires
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function ImportSquires($number = 5) {
set_time_limit(600);
echo "<h2>Import Squires</h2>";
- 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 ImportKnightAccomplish
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function ImportKnightAccomplish($number = 5) {
set_time_limit(600);
echo "<h2>Import Knight Accomplishments</h2>";
- 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 ImportGroups
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function ImportGroups($number = 5) {
set_time_limit(600);
echo "<h2>Import Groups</h2>";
- 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 ImportMisc
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function ImportMisc($number = 5) {
set_time_limit(600);
echo "<h2>Import Misc</h2>";
- 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 ImportPositions
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function ImportPositions($number = 10) {
set_time_limit(600);
echo "<h2>Import Positions</h2>";
- 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 ImportKnights
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ImportKnights($number = 5) {
set_time_limit(600);
echo "<h2>Import Knights</h2>";
Method ImportVisitorCredits
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ImportVisitorCredits($number = 5) {
set_time_limit(600);
echo "<h2>Import Visitor Credits</h2>";
Method ImportCompanyMembers
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ImportCompanyMembers($number = 5) {
set_time_limit(120);
echo "<h2>Import Company Members</h2>";
Method ImportPrincipalityParks
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ImportPrincipalityParks($number = 20) {
global $STATES;
echo "<h2>Import Principality Parks</h2>";
Method ImportKingdomParks
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ImportKingdomParks($number = 20) {
global $STATES;
echo "<h2>Import Kingdom Parks</h2>";
Method InitializeImport
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function InitializeImport() {
if ($this->IsStarted()) {
$this->cache = new Yapo($this->ORK2, 'dbimport_cache');
$this->status = new Yapo($this->ORK2, 'dbimport_status');
return;
Method ImportSquires
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ImportSquires($number = 5) {
set_time_limit(600);
echo "<h2>Import Squires</h2>";
Method ImportMasters
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ImportMasters($number = 5) {
set_time_limit(600);
echo "<h2>Import Masters</h2>";
Method ImportAwards
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ImportAwards($number = 5) {
set_time_limit(600);
echo "<h2>Import Awards</h2>";
Method ImportPositions
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ImportPositions($number = 10) {
set_time_limit(600);
echo "<h2>Import Positions</h2>";
Method ImportMisc
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ImportMisc($number = 5) {
set_time_limit(600);
echo "<h2>Import Misc</h2>";
Method ImportCompanyAwards
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ImportCompanyAwards($number = 5) {
set_time_limit(600);
echo "<h2>Import Company Awards</h2>";
Method ImportKnightAccomplish
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ImportKnightAccomplish($number = 5) {
set_time_limit(600);
echo "<h2>Import Knight Accomplishments</h2>";
Function ImportCompanyAwards
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function ImportCompanyAwards($number = 5) {
set_time_limit(600);
echo "<h2>Import Company Awards</h2>";
- 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 ImportAwards
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function ImportAwards($number = 5) {
set_time_limit(600);
echo "<h2>Import Awards</h2>";
- 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 ImportMasters
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function ImportMasters($number = 5) {
set_time_limit(600);
echo "<h2>Import Masters</h2>";
- 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 ImportGroups
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ImportGroups($number = 5) {
set_time_limit(600);
echo "<h2>Import Groups</h2>";
Function ImportCompanyMembers
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function ImportCompanyMembers($number = 5) {
set_time_limit(120);
echo "<h2>Import Company Members</h2>";
- 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 ImportOtherAwards
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function ImportOtherAwards() {
/*
* - companyawards
* - knightsbelts
* - squires
- 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 ImportVisitorCredits
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function ImportVisitorCredits($number = 5) {
set_time_limit(600);
echo "<h2>Import Visitor Credits</h2>";
- 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 ImportPrincipalities
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ImportPrincipalities() {
echo "<h2>Import Principalities</h2>";
list($princip_id, $detail) = $this->LastStatus('princips');
Method ImportKingdoms
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ImportKingdoms() {
echo "<h2>Import Kingdoms</h2>";
list($kingdom_id, $detail) = $this->LastStatus('kingdoms', array(14));
Function ImportPlayers
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function ImportPlayers($number = 20) {
set_time_limit(120);
echo "<h2>Import Players</h2>";
- 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 ($this->ImportGroups(5000) == 0) {
return 0;
}
Method RecordTransfer
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function RecordTransfer($ork2_t, $ork3_t, $ork2_id, $ork3_id, $status, $wl = 0) {
Method AddCacheLine
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function AddCacheLine($ork2_t, $ork3_t, $ork2_id, $ork3_id, $status = null) {
Similar blocks of code found in 2 locations. Consider refactoring. Open
function ImportKnightAccomplish($number = 5) {
set_time_limit(600);
echo "<h2>Import Knight Accomplishments</h2>";
- 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 317.
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
function ImportGroups($number = 5) {
set_time_limit(600);
echo "<h2>Import Groups</h2>";
- 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 317.
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 ($chapters->size() > 0) do {
set_time_limit(120);
if ($chapters->kingdomID == 2) continue;
echo "Create Principality Park {$chapters->name}<br />";
list($tmp, $kingdom_id) = $this->CacheMap('princips', $chapters->principID);
- 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 281.
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 ($chapters->size() > 0) do {
set_time_limit(120);
if ($chapters->kingdomID == 2) continue;
echo "Create Kingdom Park {$chapters->name}<br />";
list($tmp, $kingdom_id) = $this->CacheMap('kingdoms', $chapters->kingdomID);
- 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 281.
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