File edit.php
has 313 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php if ($event['deleted']): ?>
<div class="row-fluid">
<div class="alert">
<strong>Heads up!</strong> This postmortem was deleted.
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (isset($feature['custom_js_assets'])) {
// If we are just configured "on" then default to
// include a js file named after the feature
if ($feature['custom_js_assets'] === "on") {
$feature['custom_js_assets'] = array("{$feature_name}.js");
- 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 157.
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 (isset($feature['custom_css_assets'])) {
// If we are just configured "on" then default to
// include a css file named after the feature
if ($feature['custom_css_assets'] === "on") {
$feature['custom_css_assets'] = array("{$feature_name}.css");
- 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 157.
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 3 locations. Consider refactoring. Open
if (array_key_exists('incident_cause', $config)) {
$incidentCauseConfig = $config['incident_cause'];
$incidentCauseTitle = $incidentCauseConfig['title'];
$incidentCauseList = $incidentCauseConfig['causes'];
?>
- 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 90.
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 3 locations. Consider refactoring. Open
if (array_key_exists('problem_type', $config)) {
$problemTypeConfig= $config['problem_type'];
$problemTypeTitle = $problemTypeConfig['title'];
$problemTypeList = $problemTypeConfig['types'];
?>
- 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 90.
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 3 locations. Consider refactoring. Open
if (array_key_exists('impact_type', $config)) {
$impactTypeConfig = $config['impact_type'];
$impactTypeTitle = $impactTypeConfig['title'];
$impactTypeList = $impactTypeConfig['types'];
?>
- 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 90.
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
Spaces must be used to indent lines; tabs are not allowed Open
/*
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 10 Open
$problemTypeTitle = $problemTypeConfig['title'];
- Exclude checks
Line indented incorrectly; expected 24 spaces, found 22 Open
}
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 26 Open
<?php
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 10 Open
<?php
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 8 Open
foreach ($edit_page_features as $feature_name) {
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
<?php if ($event['deleted']): ?>
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
}
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 26 Open
?>
- Exclude checks
Line indented incorrectly; expected 24 spaces, found 22 Open
?>
- Exclude checks
Line indented incorrectly; expected 24 spaces, found 22 Open
?>
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 26 Open
?>
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
}
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 10 Open
$problemTypeList = $problemTypeConfig['types'];
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 10 Open
$impactTypeConfig = $config['impact_type'];
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 10 Open
<?php
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 11 Open
if (isset($config['severity']) && isset($config['severity']['tooltip_title'])) {
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 6 Open
if (array_key_exists('incident_cause', $config)) {
- Exclude checks
Line indented incorrectly; expected at least 28 spaces, found 26 Open
$selected = ($problem_type == $problemType) ? " selected " : "";
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 6 Open
?>
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
<?php if ($event['deleted']): ?>
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 6 Open
<?php
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
if (!is_array($feature['custom_css_assets'])) {
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
foreach ($edit_page_features as $feature_name) {
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
}
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 16 Open
if (strpos($js_file, "https://") === false && strpos($js_file, "http://") === false) {
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 10 Open
$impactTypeTitle = $impactTypeConfig['title'];
- Exclude checks
Line indented incorrectly; expected 24 spaces, found 22 Open
<?php
- Exclude checks
Line indented incorrectly; expected 24 spaces, found 22 Open
foreach ($impactTypeList as $impactType) {
- Exclude checks
Line indented incorrectly; expected 24 spaces, found 22 Open
}
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 6 Open
?>
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
if ($feature['custom_css_assets'] === "on") {
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
}
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
} else {
- Exclude checks
Closing brace indented incorrectly; expected 11 spaces, found 12 Open
} else {
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 26 Open
<?php
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 10 Open
<?php
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
<?php else: ?>
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
}
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
<?php if ($edit_status === Postmortem::EDIT_LOCKED): ?>
- Exclude checks
Expected 1 space after ELSE keyword; 0 found Open
<?php else: ?>
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
}
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 6 Open
}
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 10 Open
$impactTypeList = $impactTypeConfig['types'];
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 6 Open
}
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 12 Open
}
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 8 Open
}
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 16 Open
}
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
}
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 10 Open
?>
- Exclude checks
Line indented incorrectly; expected 24 spaces, found 22 Open
}
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
<?php if ($edit_status === Postmortem::EDIT_UNLOCKED): ?>
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 6 Open
<?php
- Exclude checks
Line indented incorrectly; expected 24 spaces, found 22 Open
foreach ($problemTypeList as $problemType) {
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 26 Open
<?php
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 10 Open
?>
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
}
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 16 Open
if (strpos($css_file, "https://") === false && strpos($css_file, "http://") === false) {
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
if (!is_array($feature['custom_js_assets'])) {
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 16 Open
} else {
- Exclude checks
Line indented incorrectly; expected 24 spaces, found 22 Open
<?php
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 10 Open
$incidentCauseTitle = $incidentCauseConfig['title'];
- Exclude checks
Line indented incorrectly; expected at least 28 spaces, found 26 Open
$selected = ($incident_cause == $incidentCause) ? " selected " : "";
- Exclude checks
Line indented incorrectly; expected 24 spaces, found 22 Open
?>
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 16 Open
}
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
} else {
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 16 Open
}
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
<?php if ($event['deleted']): ?>
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 10 Open
?>
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 10 Open
$incidentCauseConfig = $config['incident_cause'];
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 6 Open
}
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 12 Open
if ($feature['enabled'] == "on") {
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
if (isset($feature['custom_css_assets'])) {
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
<?php if ($edit_status === Postmortem::EDIT_CLOSED): ?>
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
} else {
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 6 Open
if (array_key_exists('problem_type', $config)) {
- Exclude checks
Line indented incorrectly; expected 24 spaces, found 22 Open
<?php
- Exclude checks
Line indented incorrectly; expected 24 spaces, found 22 Open
foreach ($incidentCauseList as $incidentCause) {
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 16 Open
if ($view_path_exists) {
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
<?php endif; ?>
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
}
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
if (isset($feature['custom_js_assets'])) {
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 6 Open
if (array_key_exists('impact_type', $config)) {
- Exclude checks
Line indented incorrectly; expected at least 28 spaces, found 26 Open
$selected = ($impact_type == $impactType) ? " selected " : "";
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
if ($feature['custom_js_assets'] === "on") {
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 16 Open
} else {
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
}
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 10 Open
$problemTypeConfig= $config['problem_type'];
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 26 Open
?>
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 10 Open
$incidentCauseList = $incidentCauseConfig['causes'];
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 16 Open
} else {
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
foreach ($css_assets as $css_file) {
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
foreach ($js_assets as $js_file) {
- Exclude checks