PHPOffice/PHPPresentation

View on GitHub

Showing 41 of 325 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                        if ($subShape instanceof ShapeTable) {
                            // Rows
                            $countRows = count($subShape->getRows());
                            for ($row = 0; $row < $countRows; ++$row) {
                                // Cells in rows
Severity: Major
Found in src/PhpPresentation/Writer/PowerPoint2007/PptSlides.php and 1 other location - About 7 hrs to fix
src/PhpPresentation/Writer/PowerPoint2007/PptSlides.php on lines 182..214

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 244.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                if ($shape instanceof ShapeTable) {
                    // Rows
                    $countRows = count($shape->getRows());
                    for ($row = 0; $row < $countRows; ++$row) {
                        // Cells in rows
Severity: Major
Found in src/PhpPresentation/Writer/PowerPoint2007/PptSlides.php and 1 other location - About 7 hrs to fix
src/PhpPresentation/Writer/PowerPoint2007/PptSlides.php on lines 257..289

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 244.

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

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

                foreach ($richtexts as $richtext) {
                    ++$richtextId;
                    if ($richtext instanceof TextElement) {
                        // text:span
                        $objWriter->startElement('text:span');
Severity: Major
Found in src/PhpPresentation/Writer/ODPresentation/Content.php and 1 other location - About 6 hrs to fix
src/PhpPresentation/Writer/ODPresentation/Content.php on lines 536..563

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 205.

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

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

                foreach ($richtexts as $richtext) {
                    ++$richtextId;
                    if ($richtext instanceof TextElement) {
                        // text:span
                        $objWriter->startElement('text:span');
Severity: Major
Found in src/PhpPresentation/Writer/ODPresentation/Content.php and 1 other location - About 6 hrs to fix
src/PhpPresentation/Writer/ODPresentation/Content.php on lines 600..627

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 205.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                        if (0x0 == $friendlyNameAtom['recVer'] && 0x000 == $friendlyNameAtom['recInstance'] && self::RT_CSTRING == $friendlyNameAtom['recType'] && $friendlyNameAtom['recLen'] % 2 == 0) {
                            $pos += 8;
                            $exObjList['recLen'] -= 8;
                            $this->arrayHyperlinks[$exHyperlinkId]['text'] = '';
                            for ($inc = 0; $inc < ($friendlyNameAtom['recLen'] / 2); ++$inc) {
Severity: Major
Found in src/PhpPresentation/Reader/PowerPoint97.php and 1 other location - About 4 hrs to fix
src/PhpPresentation/Reader/PowerPoint97.php on lines 791..801

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                        if (0x0 == $targetAtom['recVer'] && 0x001 == $targetAtom['recInstance'] && self::RT_CSTRING == $targetAtom['recType'] && $targetAtom['recLen'] % 2 == 0) {
                            $pos += 8;
                            $exObjList['recLen'] -= 8;
                            $this->arrayHyperlinks[$exHyperlinkId]['url'] = '';
                            for ($inc = 0; $inc < ($targetAtom['recLen'] / 2); ++$inc) {
Severity: Major
Found in src/PhpPresentation/Reader/PowerPoint97.php and 1 other location - About 4 hrs to fix
src/PhpPresentation/Reader/PowerPoint97.php on lines 778..788

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                    case 0x0181:
                        // Fill : fillColor
                        //@link : http://msdn.microsoft.com/en-us/library/dd921332(v=office.12).aspx
                        $strColor = str_pad(dechex(($opt['op'] >> 0) & bindec('11111111')), 2, '0', STR_PAD_LEFT);
                        $strColor .= str_pad(dechex(($opt['op'] >> 8) & bindec('11111111')), 2, '0', STR_PAD_LEFT);
Severity: Major
Found in src/PhpPresentation/Reader/PowerPoint97.php and 1 other location - About 3 hrs to fix
src/PhpPresentation/Reader/PowerPoint97.php on lines 2145..2153

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 161.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                    case 0x0183:
                        // Fill : fillBackColor
                        //@link : http://msdn.microsoft.com/en-us/library/dd950634(v=office.12).aspx
                        $strColor = str_pad(dechex(($opt['op'] >> 0) & bindec('11111111')), 2, '0', STR_PAD_LEFT);
                        $strColor .= str_pad(dechex(($opt['op'] >> 8) & bindec('11111111')), 2, '0', STR_PAD_LEFT);
Severity: Major
Found in src/PhpPresentation/Reader/PowerPoint97.php and 1 other location - About 3 hrs to fix
src/PhpPresentation/Reader/PowerPoint97.php on lines 2136..2144

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 161.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                if ($shape instanceof RichText) {
                    foreach ($shape->getParagraphs() as $paragraph) {
                        foreach ($paragraph->getRichTextElements() as $element) {
                            if ($element instanceof Run || $element instanceof TextElement) {
                                if ($element->hasHyperlink()) {
Severity: Major
Found in src/PhpPresentation/Writer/PowerPoint2007/PptSlides.php and 1 other location - About 3 hrs to fix
src/PhpPresentation/Writer/PowerPoint2007/PptSlides.php on lines 234..254

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 149.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                        if ($subShape instanceof RichText) {
                            foreach ($subShape->getParagraphs() as $paragraph) {
                                foreach ($paragraph->getRichTextElements() as $element) {
                                    if ($element instanceof Run || $element instanceof TextElement) {
                                        if ($element->hasHyperlink()) {
Severity: Major
Found in src/PhpPresentation/Writer/PowerPoint2007/PptSlides.php and 1 other location - About 3 hrs to fix
src/PhpPresentation/Writer/PowerPoint2007/PptSlides.php on lines 159..179

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 149.

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

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

    private function readRecordShapeFlags10Atom(string $stream, int $pos): array
    {
        $arrayReturn = [
            'length' => 0,
        ];
Severity: Major
Found in src/PhpPresentation/Reader/PowerPoint97.php and 7 other locations - About 2 hrs to fix
src/PhpPresentation/Reader/PowerPoint97.php on lines 1066..1081
src/PhpPresentation/Reader/PowerPoint97.php on lines 2513..2528
src/PhpPresentation/Reader/PowerPoint97.php on lines 2561..2576
src/PhpPresentation/Reader/PowerPoint97.php on lines 2585..2600
src/PhpPresentation/Reader/PowerPoint97.php on lines 2657..2672
src/PhpPresentation/Reader/PowerPoint97.php on lines 2867..2882
src/PhpPresentation/Reader/PowerPoint97.php on lines 2947..2962

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 122.

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

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

    private function readRecordPlaceholderAtom(string $stream, int $pos): array
    {
        $arrayReturn = [
            'length' => 0,
        ];
Severity: Major
Found in src/PhpPresentation/Reader/PowerPoint97.php and 7 other locations - About 2 hrs to fix
src/PhpPresentation/Reader/PowerPoint97.php on lines 1066..1081
src/PhpPresentation/Reader/PowerPoint97.php on lines 2561..2576
src/PhpPresentation/Reader/PowerPoint97.php on lines 2585..2600
src/PhpPresentation/Reader/PowerPoint97.php on lines 2633..2648
src/PhpPresentation/Reader/PowerPoint97.php on lines 2657..2672
src/PhpPresentation/Reader/PowerPoint97.php on lines 2867..2882
src/PhpPresentation/Reader/PowerPoint97.php on lines 2947..2962

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 122.

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

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

    private function readRecordRoundTripHFPlaceholder12Atom(string $stream, int $pos): array
    {
        $arrayReturn = [
            'length' => 0,
        ];
Severity: Major
Found in src/PhpPresentation/Reader/PowerPoint97.php and 7 other locations - About 2 hrs to fix
src/PhpPresentation/Reader/PowerPoint97.php on lines 1066..1081
src/PhpPresentation/Reader/PowerPoint97.php on lines 2513..2528
src/PhpPresentation/Reader/PowerPoint97.php on lines 2585..2600
src/PhpPresentation/Reader/PowerPoint97.php on lines 2633..2648
src/PhpPresentation/Reader/PowerPoint97.php on lines 2657..2672
src/PhpPresentation/Reader/PowerPoint97.php on lines 2867..2882
src/PhpPresentation/Reader/PowerPoint97.php on lines 2947..2962

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 122.

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

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

    private function readRecordShapeFlagsAtom(string $stream, int $pos): array
    {
        $arrayReturn = [
            'length' => 0,
        ];
Severity: Major
Found in src/PhpPresentation/Reader/PowerPoint97.php and 7 other locations - About 2 hrs to fix
src/PhpPresentation/Reader/PowerPoint97.php on lines 1066..1081
src/PhpPresentation/Reader/PowerPoint97.php on lines 2513..2528
src/PhpPresentation/Reader/PowerPoint97.php on lines 2561..2576
src/PhpPresentation/Reader/PowerPoint97.php on lines 2585..2600
src/PhpPresentation/Reader/PowerPoint97.php on lines 2633..2648
src/PhpPresentation/Reader/PowerPoint97.php on lines 2867..2882
src/PhpPresentation/Reader/PowerPoint97.php on lines 2947..2962

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 122.

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

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

    private function readRecordSlideNumberMCAtom(string $stream, int $pos): array
    {
        $arrayReturn = [
            'length' => 0,
        ];
Severity: Major
Found in src/PhpPresentation/Reader/PowerPoint97.php and 7 other locations - About 2 hrs to fix
src/PhpPresentation/Reader/PowerPoint97.php on lines 1066..1081
src/PhpPresentation/Reader/PowerPoint97.php on lines 2513..2528
src/PhpPresentation/Reader/PowerPoint97.php on lines 2561..2576
src/PhpPresentation/Reader/PowerPoint97.php on lines 2585..2600
src/PhpPresentation/Reader/PowerPoint97.php on lines 2633..2648
src/PhpPresentation/Reader/PowerPoint97.php on lines 2657..2672
src/PhpPresentation/Reader/PowerPoint97.php on lines 2947..2962

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 122.

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

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

    private function readRecordExObjRefAtom(string $stream, int $pos): array
    {
        $arrayReturn = [
            'length' => 0,
        ];
Severity: Major
Found in src/PhpPresentation/Reader/PowerPoint97.php and 7 other locations - About 2 hrs to fix
src/PhpPresentation/Reader/PowerPoint97.php on lines 2513..2528
src/PhpPresentation/Reader/PowerPoint97.php on lines 2561..2576
src/PhpPresentation/Reader/PowerPoint97.php on lines 2585..2600
src/PhpPresentation/Reader/PowerPoint97.php on lines 2633..2648
src/PhpPresentation/Reader/PowerPoint97.php on lines 2657..2672
src/PhpPresentation/Reader/PowerPoint97.php on lines 2867..2882
src/PhpPresentation/Reader/PowerPoint97.php on lines 2947..2962

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 122.

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

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

    private function readRecordRoundTripShapeId12Atom(string $stream, int $pos): array
    {
        $arrayReturn = [
            'length' => 0,
        ];
Severity: Major
Found in src/PhpPresentation/Reader/PowerPoint97.php and 7 other locations - About 2 hrs to fix
src/PhpPresentation/Reader/PowerPoint97.php on lines 1066..1081
src/PhpPresentation/Reader/PowerPoint97.php on lines 2513..2528
src/PhpPresentation/Reader/PowerPoint97.php on lines 2561..2576
src/PhpPresentation/Reader/PowerPoint97.php on lines 2633..2648
src/PhpPresentation/Reader/PowerPoint97.php on lines 2657..2672
src/PhpPresentation/Reader/PowerPoint97.php on lines 2867..2882
src/PhpPresentation/Reader/PowerPoint97.php on lines 2947..2962

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 122.

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

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

    private function readRecordSlideShowSlideInfoAtom(string $stream, int $pos): array
    {
        $arrayReturn = [
            'length' => 0,
        ];
Severity: Major
Found in src/PhpPresentation/Reader/PowerPoint97.php and 7 other locations - About 2 hrs to fix
src/PhpPresentation/Reader/PowerPoint97.php on lines 1066..1081
src/PhpPresentation/Reader/PowerPoint97.php on lines 2513..2528
src/PhpPresentation/Reader/PowerPoint97.php on lines 2561..2576
src/PhpPresentation/Reader/PowerPoint97.php on lines 2585..2600
src/PhpPresentation/Reader/PowerPoint97.php on lines 2633..2648
src/PhpPresentation/Reader/PowerPoint97.php on lines 2657..2672
src/PhpPresentation/Reader/PowerPoint97.php on lines 2867..2882

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 122.

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

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

    private function readRecordDrawingGroupContainer(string $stream, int $pos): array
    {
        $arrayReturn = [
            'length' => 0,
        ];
Severity: Major
Found in src/PhpPresentation/Reader/PowerPoint97.php and 5 other locations - About 1 hr to fix
src/PhpPresentation/Reader/PowerPoint97.php on lines 2489..2504
src/PhpPresentation/Reader/PowerPoint97.php on lines 2537..2552
src/PhpPresentation/Reader/PowerPoint97.php on lines 2609..2624
src/PhpPresentation/Reader/PowerPoint97.php on lines 2681..2696
src/PhpPresentation/Reader/PowerPoint97.php on lines 2891..2906

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 110.

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

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

    private function readRecordPerSlideHeadersFootersContainer(string $stream, int $pos): array
    {
        $arrayReturn = [
            'length' => 0,
        ];
Severity: Major
Found in src/PhpPresentation/Reader/PowerPoint97.php and 5 other locations - About 1 hr to fix
src/PhpPresentation/Reader/PowerPoint97.php on lines 1043..1057
src/PhpPresentation/Reader/PowerPoint97.php on lines 2537..2552
src/PhpPresentation/Reader/PowerPoint97.php on lines 2609..2624
src/PhpPresentation/Reader/PowerPoint97.php on lines 2681..2696
src/PhpPresentation/Reader/PowerPoint97.php on lines 2891..2906

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 110.

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

Further Reading

Severity
Category
Status
Source
Language