Method imports
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function imports() {
chmod($this->uploadDir, 0777);
if (count($_FILES)) {
$this->saveCSVFile();
chmod($this->uploadDir . $this->csvFileName, 0777);
- Create a ticketCreate a ticket
Function imports
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function imports() {
chmod($this->uploadDir, 0777);
if (count($_FILES)) {
$this->saveCSVFile();
chmod($this->uploadDir . $this->csvFileName, 0777);
- Read upRead up
- Create a ticketCreate a ticket
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 configureImportProcess
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function configureImportProcess($vector = true) {
if (file_exists($this->uploadDir . $this->csvFileName)) {
$file = fopen($this->uploadDir . $this->csvFileName, 'r');
$row = array_diff(fgetcsv($file, 1000000, ';', '"'), [null]);
fclose($file);
- Create a ticketCreate a ticket
Method saveCSVFile
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function saveCSVFile() {
$this->takeFileName();
$this->load->library(
'upload',
- Create a ticketCreate a ticket
Function convertXLStoCSV
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function convertXLStoCSV($excel_file = '') {
$objReader = PHPExcel_IOFactory::createReaderForFile($excel_file);
$objReader->setReadDataOnly(true);
$objPHPExcel = $objReader->load($excel_file);
$sheetData = $objPHPExcel->getActiveSheet()->toArray(null, true, true, true);
- Read upRead up
- Create a ticketCreate a ticket
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 configureImportProcess
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function configureImportProcess($vector = true) {
if (file_exists($this->uploadDir . $this->csvFileName)) {
$file = fopen($this->uploadDir . $this->csvFileName, 'r');
$row = array_diff(fgetcsv($file, 1000000, ';', '"'), [null]);
fclose($file);
- Read upRead up
- Create a ticketCreate a ticket
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 saveCSVFile
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function saveCSVFile() {
$this->takeFileName();
$this->load->library(
'upload',
- Read upRead up
- Create a ticketCreate a ticket
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"