Showing 1,397 of 1,397 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
while (index < length) {
if (match('}')) {
break;
}
statement = parseSourceElement();
- Read upRead up
- Create a ticketCreate a ticket
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 58.
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 4 locations. Consider refactoring. Open
Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return ieee754.read(this, offset, false, 23, 4)
}
- Read upRead up
- Create a ticketCreate a ticket
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 58.
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
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($actee = NULL, $actor = NULL, $notes = NULL, $exact = false, $begin = NULL, $end = NULL, Array $activites = NULL, $static = false, $limit = 10)
- Create a ticketCreate a ticket
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($actee = NULL, $actor = NULL, $notes = NULL, $exact = false, $begin = NULL, $end = NULL, Array $activities = NULL, $static = false, $limit = 10)
- Create a ticketCreate a ticket
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($term = null, $banner_id = null, $username = null, $gender = null, $student_type = null, $application_term = null, $cell_phone = null, $meal_plan = null, $international = null)
- Create a ticketCreate a ticket
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(string $apiKey, Array $to, Array $cc, string $fromEmail, string $fromName, string $subject, string $text, string $html, Array $metadata)
- Create a ticketCreate a ticket
Function dispatch
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
dispatch: function (data, isError) {
if (!isError) {
for (var cb in this.validators) {
if (!this.validators[cb](data)) {
isError = true;
- Create a ticketCreate a ticket
Function isKeyword
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function isKeyword(id) {
if (strict && isStrictModeReservedWord(id)) {
return true;
}
- Create a ticketCreate a ticket
Function SourceMapConsumer_eachMapping
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
var context = aContext || null;
var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
var mappings;
- Create a ticketCreate a ticket
Function byteLength
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Buffer.byteLength = function byteLength (str, encoding) {
var ret
str = str + ''
switch (encoding || 'utf8') {
case 'ascii':
- Create a ticketCreate a ticket
Function dispatch
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
dispatch: function (data, isError) {
if (!isError) {
for (var cb in this.validators) {
if (!this.validators[cb](data)) {
isError = true;
- Create a ticketCreate a ticket
Function ajaxAddOption
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.ajaxAddOption = function(url, params, select, fn, args)
{
if(typeof(url) != "string") return this;
if(typeof(params) != "object") params = {};
if(typeof(select) != "boolean") select = true;
- Create a ticketCreate a ticket
Function parseClassDeclaration
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parseClassDeclaration() {
var id, implemented, previousYieldAllowed, superClass = null,
superTypeParameters, marker = markerCreate(), typeParameters;
expectKeyword('class');
- Create a ticketCreate a ticket
Function slice
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Buffer.prototype.slice = function slice (start, end) {
var len = this.length
start = ~~start
end = end === undefined ? len : ~~end
- Create a ticketCreate a ticket
Function parsePropertyFunction
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parsePropertyFunction(options) {
var previousStrict, previousYieldAllowed, previousAwaitAllowed,
params, defaults, body, marker = markerCreate();
previousStrict = strict;
- Create a ticketCreate a ticket
Function cookie
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
var config = $.cookie = function (key, value, options) {
// write
if (value !== undefined) {
options = $.extend({}, config.defaults, options);
- Create a ticketCreate a ticket
Function componentDidMount
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
componentDidMount(){
let that = this;
fetch('./index.php?module=hms&action=GetEmailLogMessageList&bannerId=' + this.props.studentId, {credentials: 'same-origin'})
.then(function(response){
- Create a ticketCreate a ticket
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render(){
if(this.props.alert === undefined || this.props.alert.message === "") {
return (<div></div>)
} else {
var success = false;
- Create a ticketCreate a ticket
Method count_invites_by_class
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function count_invites_by_class($term, $class)
{
$now = time();
$term_year = Term::getTermYear($term);
- Create a ticketCreate a ticket
Method create_new_table
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function create_new_table($pdo)
{
$table_name = TABLE_NAME;
$query = <<<EOF
CREATE TABLE $table_name (
- Create a ticketCreate a ticket